我有一个能够与旧的 ASMX Web 服务通信的第三方 SOAP 客户端。
问题在于 WCF 服务。
我的 WCF 服务从该客户端接收消息没有问题,但客户端不喜欢我的 WCF 响应。
我的测试 WCF 服务发出以下响应:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
 <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <testResponse xmlns="http://www.tempuri.org">
   <testResult>randomStringData</testResult>
  </testResponse>
 </s:Body>
</s:Envelope>
但是旧的 SOAP 客户端需要这种响应(ASMX 服务):
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <soap:Body>
  <testResponse xmlns="http://tempuri.org/">
   <testResult>randomStringData</testResult>
  </testResponse>
 </soap:Body>
</soap:Envelope>
我无法控制客户。有没有办法可以配置我的 WCF 以发送与我的 ASMX 服务完全相同的消息?
我的 WCF 服务使用以下绑定:
<customBinding>
    <binding name="soap11">
      <textMessageEncoding messageVersion="Soap11" writeEncoding="utf-8"></textMessageEncoding>
      <httpTransport></httpTransport>
    </binding>
  </customBinding>