I have been trying to port a legacy WSE 3 web service to WCF. Since maintaining backwards compatibility with WSE 3 clients is the goal, I've followed the guidance in this article.
After much trial and error, I can call the WCF service from my WSE 3 client. However, I am unable to add or update a web reference to this service from Visual Studio 2005 (with WSE 3 installed). The response is "The request failed with HTTP status 400: Bad Request". I get the same error trying to generate the proxy using the wsewsdl3 utility. I can add a Service Reference using VS 2008.
I've tried hosting the service in IIS 7.5 on both Windows 7 and Windows 2008 Server R2 with the same result. Any solutions or troubleshooting suggestions?
Here are the relevant sections from the config file for my WCF service.
<system.serviceModel>
<services>
<service behaviorConfiguration="MyBehavior"
name="MyService">
<endpoint address="" binding="customBinding" bindingConfiguration="wseBinding"
contract="IMyService" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<customBinding>
<binding name="wseBinding">
<security authenticationMode="UserNameOverTransport" />
<mtomMessageEncoding messageVersion="Soap11WSAddressingAugust2004" />
<httpsTransport/>
</binding>
</customBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="MyBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="MyCustomValidator" />
</serviceCredentials>
<serviceAuthorization principalPermissionMode="UseAspNetRoles" roleProviderName="MyRoleProvider" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
UPDATE: After trying Paul's tracing suggestion, I have determined that the exception is System.Xml.XmlException: The body of the message cannot be read because it is empty
Unfortunately, that doesn't seem to be of much help. One other thing I noticed was that there was a separate httpsGetEnabled attribute of the serviceMetadata element. I added that and set it to true since this is an https service, but the result was the same. It seems that for some reason WCF isn't recognizing that this is a metadata request.