WCF (Indigo) Baby Steps

I decided to dig into Indigo.. err, Windows Communication Foundation... for awhile this weekend.  I have done demos before and run through samples using TCP, but I have never used HTTP with it yet.  Here are some of the most obvious stumbling blocks that I think other developers are going to run into when using Visual Studio 2005 and WCF for the first time.

  • If you try to create a client proxy for a file-based ASMX service using svcutil, you are going to get a MessageSecurityException with the message "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The server authentication schemes are 'NTLM'".   When you create a file-based ASMX service, you are running it using the ASP.NET Development Server (aka Cassini).Steve Maine's post on Indigo and Cassini clears this one up.
  • If you are generating a client proxy for an ASMX service using svcutil, use the /uxs switch to use the XmlSerializer when generating the client proxy.
  • To control the namespace binding for wsdl:types, specify the namespace property in the DataContract attribute.  To control the namespace binding for wsdl:deinitions, specify the namespace property on the ServiceContract attribute.  This will get you away from the tempuri.org namespace binding.
  • If you have been watching Steve Swartz' and Don Box' demos on Indigo, you will have noticed that the config data generated by svcutil is considerably more verbose than the address, binding, and contract samples they use.  You can either use the config info that svcutil generates in output.config (noting Steve's advice above), or you can trim up considerably by using the basicHttpBinding (which also forces you to look at bindings more closely):

<

client>

<

endpoint address=https://localhost:8080/MyDemo/Service.asmx

binding="basicHttpBinding"

configurationName="ServiceSoap" contract="ServiceSoap" />

</

client>

I was going to work on some WSE 3.0 interop scenarios tonight, but can't seem to get WSE 3.0 installed with the WinFX September CTP.  Instead, I am doing some hacking to see what weird scenarios I can make work with WCF and WSE 2.0.  Next up is Workflow.