I have a WCF service hosted under IIS, behind a load balancer. SSL is offloaded at the LB and then the service is called in plain HTTP.
I got the REST endpoint of the service working but I can’t seem to make the SOAP endpoint to display the wsdl page. When calling https://domain/Service.svc/soap?wsdl the browser receives a 400 Bar Request response. I inspected the svclog too and the error is There is a problem with the XML that was received from the network. See inner exception for more details. which means that it was expecting me to do a POST instead of GET and to send an XML over.
Snippets from the configs:
<bindings>
<basicHttpBinding>
<binding name="basicBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="Transport"></security>
<readerQuotas maxStringContentLength="2147483647" />
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="webBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="Transport"></security>
</binding>
</webHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="MyServiceBehavior" name="Namespace.Service">
<endpoint address="" behaviorConfiguration="MyRESTBehavior" binding="webHttpBinding" bindingConfiguration="webBinding" name="REST" contract="Namespace.IService" />
<endpoint address="https://domain/Service.svc/soap" binding="basicHttpBinding" bindingConfiguration="basicBinding" name="SOAP" contract="Namespace.IService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="6553600" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="MyRESTBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
I tried using wsHttpBinding too but the only different result was getting 401s instead. Any directions appreciated.
I found it. I had previously removed the
httpsGetUrlattribute from theserviceMetadatabecause I was getting an error about publishing a service twice. I now think that error was probably due to a typo and I shouldn’t have removed thehttpsGetUrl. Changing thebehaviorssection to the one below has solved my problem: