If you are still stuck in the .NET 2.0 world and want to use WS-Security, here is the rescue:
WSE 2.0
Thursday, March 24, 2011
Something new again (Two-way SSL Certificate for Web Services)
1. The Intermediate Certificate should be in the Intermediate Store for IIS, otherwise it will not be able to verify the chain of certificates.
2. The certificate store should be for Local Computer, not Current User. And
3. If it doesn't work, delete all certs, restart IIS and do it all over again!
2. The certificate store should be for Local Computer, not Current User. And
3. If it doesn't work, delete all certs, restart IIS and do it all over again!
Wednesday, March 23, 2011
Something new (for me) everyday: Easy upsert in SQL Server Integration Services
See here. It also mentions the "Instead of" triggers that are (apparently) there since SQL Server 2000. I can see some magical use of these.
Thursday, February 24, 2011
script tag
This is something that outraged me when I ventured into the la-la land of javascript... :)
If you want to have a <script> tag in html, it can not be something like <script .../>, as any self-respecting tag can do (and a valid scenario when you have a "src" attribute). But rather, you need to have <script ...></script>. This is nuts!
And the reason is that it is not conforming to the xhtml standard as it requires (#PCDATA), thus can not be self-closed...
No matter who comes up with this has to be a nutjob.
If you want to have a <script> tag in html, it can not be something like <script .../>, as any self-respecting tag can do (and a valid scenario when you have a "src" attribute). But rather, you need to have <script ...></script>. This is nuts!
And the reason is that it is not conforming to the xhtml standard as it requires (#PCDATA), thus can not be self-closed...
No matter who comes up with this has to be a nutjob.
atdmt.com and all its troubles
I got a mysterious problem on my Windows 2008 Server R2 machine that drove me crazy. And it doesn't show up on other machines that I have. Here is the problem: When I log into Hotmail, for every email that I click, I will get a popup dialog asking for credentials. And it won't go away unless: Either I click cancel, or if I enter some gabbage and click OK, it will popup again for a total of three times. And the whole thing starts all over again once I click another email. Add insult to the injury, this problem is with every browser that I try.
This behavior is very close to, actully the same as, the behavior for a NTLM enabled website. This makes it bizarre as no sane website would do this on the internet. I did a tone of googling on "hotmail atdmt" and various combinations. And the only result I got refers to the atdmt tracking cookie, which is not really related.
So I finally got fed up and decided that not able to view hotmail is a big deal for my development machine. :). And fired up fiddler on two machines to compare what is going on. And here is what I found:
1. The h.atdmt.com reference was redirected by h.live.com.
2. The h.atdmt.com returned 401 Unauthorized and ask for either "Negotiate" or "NTLM". Another funny part is that it is an IIS/7.5 with Sharepoint 14. (wink)
3. On the "good" machine, this same request will be actively rejected by the host. (wink again.)
4. And finally, the IP address of h.atdmt.com is "127.0.0.1", for both machines!
Everybody knows that "127.0.0.1" is the local host. And that's weird. I tried ping it and get the same result. There is no proxy on my machine so it must be happening from DNS server. But why?
Before I start to venture about the answer to the question, this phenomenome is explained well by the facts that:
a. I have a SharePoint 2010 installed on my local machine and it requires NTLM.
b. There is no webserver on the "good" machine.
So when a request is made to h.atdmt.com(127.0.0.1), the XP machine ("good" machine) rejected it immediately while the 2k8 server replies with 401 and indicates for NTLM (or Negotiate). And the clients faithfully ask for credentials every time!
What I guess the reason this is happening is: For some reason, the central IT people wants to block tracking done by atdmt.com. And what they choose to do is returning 127.0.0.1 when asked for atdmt.com, thus blocking it at DNS level. And unfortunately, hotmail has a love affair with atdmt and try to track every email click that way. And, because I am a developer and have a NTLM enabled website, I got hosed.
Once I got the problem identified, the solution is simple. I added h.atdmt.com to hosts file and gave it an address not in the network. And it works good after that. Thank God, there is peace in the world again...
This behavior is very close to, actully the same as, the behavior for a NTLM enabled website. This makes it bizarre as no sane website would do this on the internet. I did a tone of googling on "hotmail atdmt" and various combinations. And the only result I got refers to the atdmt tracking cookie, which is not really related.
So I finally got fed up and decided that not able to view hotmail is a big deal for my development machine. :). And fired up fiddler on two machines to compare what is going on. And here is what I found:
1. The h.atdmt.com reference was redirected by h.live.com.
2. The h.atdmt.com returned 401 Unauthorized and ask for either "Negotiate" or "NTLM". Another funny part is that it is an IIS/7.5 with Sharepoint 14. (wink)
3. On the "good" machine, this same request will be actively rejected by the host. (wink again.)
4. And finally, the IP address of h.atdmt.com is "127.0.0.1", for both machines!
Everybody knows that "127.0.0.1" is the local host. And that's weird. I tried ping it and get the same result. There is no proxy on my machine so it must be happening from DNS server. But why?
Before I start to venture about the answer to the question, this phenomenome is explained well by the facts that:
a. I have a SharePoint 2010 installed on my local machine and it requires NTLM.
b. There is no webserver on the "good" machine.
So when a request is made to h.atdmt.com(127.0.0.1), the XP machine ("good" machine) rejected it immediately while the 2k8 server replies with 401 and indicates for NTLM (or Negotiate). And the clients faithfully ask for credentials every time!
What I guess the reason this is happening is: For some reason, the central IT people wants to block tracking done by atdmt.com. And what they choose to do is returning 127.0.0.1 when asked for atdmt.com, thus blocking it at DNS level. And unfortunately, hotmail has a love affair with atdmt and try to track every email click that way. And, because I am a developer and have a NTLM enabled website, I got hosed.
Once I got the problem identified, the solution is simple. I added h.atdmt.com to hosts file and gave it an address not in the network. And it works good after that. Thank God, there is peace in the world again...
Thursday, January 20, 2011
Frustration with idiotic .NET Generics
Do you know ObservableCollection(of Object) != ObservableCollection(of ClassA)? Of course you do. But what do you do when you have a generic collection class that you want to generalize (pardon the tone twister)? You need to do a little converter function. However, if .NET can say ObservableCollection(of ClassA) isa ObservableCollection(of Object), life will be a lot easier.
Another thing it will fix is the need to create a non-generic class as the parent type of the generic class in a class hierarchy (to ease the pain of multiple "isa" call in trying to assert the subclass' type). So you can say:
If typeof o Is GenericClass(of Object) Then
instead of
If typeof o Is GenericClassUselessParent Then
to simplify the class hierarchy.
Another thing it will fix is the need to create a non-generic class as the parent type of the generic class in a class hierarchy (to ease the pain of multiple "isa" call in trying to assert the subclass' type). So you can say:
If typeof o Is GenericClass(of Object) Then
instead of
If typeof o Is GenericClassUselessParent Then
to simplify the class hierarchy.
One thing hard learnt regarding Dependency Properties
I was scratching my head like crazy on this one but could not figure it out. It turns out that: if you put a default value of reference type in the Register function of DependencyProperty, this vaue will be shared by ALL instances of the property and cause problems. For example, if you have a property of the type Collection, then all data added to that collection will "magically" show up in other instances too! This has bothered me for a long time and I finally found a good explaination at this web page.
Subscribe to:
Posts (Atom)