Tuesday 10 March 2009

Creating an ASMX service with WCF

A few things to know when making your WCF service compatible with ASMX clients:

1. The service must expose an endpoint using the basicHttpBinding.

2. When generating the service proxy, use the Visual Studio "Add Web Service Reference" option instead of the "Add Service Reference" option.

  • In fact, the "Add Web Service Reference" uses the wsdl.exe command to generate proxies compatible with ASMX clients. Moreover, WCF will use the XmlSerializer rather than the DataContractSerializer while communicating with these clients.
  • The "Add Service Reference" option uses the svcutil.exe command to generate WCF proxies.

3. BasicHttpBinding only supports UserName and Certificate credentials. So for example, you will not be able to use Integrated Windows Authentication to secure for authenticating your WCF service ASMX client.