【发布时间】:2015-09-08 04:32:50
【问题描述】:
我正在使用第三方 Duplex 服务(假设这是因为实施了回调合同)。下面是配置部分。服务抛出异常,说它无法理解请求 XML "a:To mustUnderstand="1" 中的标签。
<endpoint address="http://vmsvalservice-uat.rpdata.com:80/vms-valuation/soap/soapws"
binding="customBinding" bindingConfiguration="VMSSSO_CustomBinding" behaviorConfiguration="VMSSSOHeader"
contract="VMSSSOService.VmsPort" name="VmsPortSoap11">
</endpoint>
<binding name="CustomBinding" receiveTimeout="00:10:00" sendTimeout="00:01:00">
<security authenticationMode="UserNameOverTransport" enableUnsecuredResponse="true" allowInsecureTransport="true"/>
<compositeDuplex clientBaseAddress="http://localhost:8080"/>
<oneWay maxAcceptedChannels ="2"></oneWay>
<textMessageEncoding messageVersion="Soap11WSAddressing10" writeEncoding="utf-8" />
<httpTransport maxBufferPoolSize="524288" maxBufferSize="524288" maxReceivedMessageSize="524288"/>
</binding>
请求 XML:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:MessageID>urn:uuid:76901ce5-0bab-42e2-ac76-18eddf367d25</a:MessageID>
<a:To s:mustUnderstand="1">http://vmsvalservice-uat.rpdata.com/vms-valuation/soap/soapws</a:To>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
我尝试了两种方法来修复它。
我已尝试 BeforeSendRequest 来控制该行为,但在调用此事件后,此标记会添加到 Soap 信封中。
尝试通过编写一个类并在接受 XML 时覆盖 MustUnderstand 属性来将 mustUnderstand 重置为 0。
无论如何我可以阻止这个标签消失或重置 MustUnderstand。
非常感谢任何建议。
【问题讨论】:
标签: c# xml soap wcf-binding soap-client