Note that there are some explanatory texts on larger screens.

plurals
  1. POHTTP 400 Bad Request error attempting to add web reference to WCF Service
    primarykey
    data
    text
    <p>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 <a href="http://msdn.microsoft.com/en-us/library/ms732008.aspx" rel="noreferrer">article</a>.</p> <p>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. </p> <p>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?</p> <p>Here are the relevant sections from the config file for my WCF service.</p> <pre><code>&lt;system.serviceModel&gt; &lt;services&gt; &lt;service behaviorConfiguration="MyBehavior" name="MyService"&gt; &lt;endpoint address="" binding="customBinding" bindingConfiguration="wseBinding" contract="IMyService" /&gt; &lt;endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /&gt; &lt;/service&gt; &lt;/services&gt; &lt;bindings&gt; &lt;customBinding&gt; &lt;binding name="wseBinding"&gt; &lt;security authenticationMode="UserNameOverTransport" /&gt; &lt;mtomMessageEncoding messageVersion="Soap11WSAddressingAugust2004" /&gt; &lt;httpsTransport/&gt; &lt;/binding&gt; &lt;/customBinding&gt; &lt;/bindings&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="MyBehavior"&gt; &lt;serviceMetadata httpGetEnabled="true" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt; &lt;serviceCredentials&gt; &lt;userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="MyCustomValidator" /&gt; &lt;/serviceCredentials&gt; &lt;serviceAuthorization principalPermissionMode="UseAspNetRoles" roleProviderName="MyRoleProvider" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" /&gt; &lt;/system.serviceModel&gt; </code></pre> <p><strong>UPDATE:</strong> After trying Paul's tracing suggestion, I have determined that the exception is <em>System.Xml.XmlException: The body of the message cannot be read because it is empty</em></p> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload