我有一个托管在 IIS 下的 WCF 服务,位于负载均衡器后面。SSL 在 LB 处卸载,然后以纯 HTTP 调用服务。
我让服务的 REST 端点正常工作,但似乎无法让 SOAP 端点显示 wsdl 页面。调用https://domain/Service.svc/soap?wsdl
浏览器时会收到 400 Bar Request 响应。我也检查了 svclog,错误是There is a problem with the XML that was received from the network. See inner exception for more details.
这意味着它希望我做一个POST
而不是GET
发送一个 XML。
来自配置的片段:
<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>
我也尝试使用 wsHttpBinding 但唯一不同的结果是得到401
s 。任何方向表示赞赏。