.net WCF Soap消息删除';至';标题

.net WCF Soap消息删除';至';标题,.net,soap,wcf-security,wcf-client,.net,Soap,Wcf Security,Wcf Client,尽管在这个问题上还有其他问题,但没有一个真正涉及到这个确切的问题。我很少问问题,因为我通常能找到答案 我们使用一个WCF客户机与一个使用SOAP1.1的JavaWeb服务进行对话。我必须创建一个自定义WseHttpBinding来添加一个userNameToken。问题在于,当请求被序列化时,会添加一堆Java服务不喜欢的头元素。具体包括: 行动 消息ID 答复 到 实际标题如下所示: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soa

尽管在这个问题上还有其他问题,但没有一个真正涉及到这个确切的问题。我很少问问题,因为我通常能找到答案

我们使用一个WCF客户机与一个使用SOAP1.1的JavaWeb服务进行对话。我必须创建一个自定义WseHttpBinding来添加一个userNameToken。问题在于,当请求被序列化时,会添加一堆Java服务不喜欢的头元素。具体包括:

行动 消息ID 答复 到

实际标题如下所示:

 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
 <s:Header>
 <a:Action s:mustUnderstand="1"/>
 <a:MessageID>urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</a:MessageID>
 <a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>
 <a:To s:mustUnderstand="1">https://xxx.xxx.xxx</a:To>

 <MORE SECURITY ELEMENTS...>
 </s:Header>
我很惊讶,它删除了一个例外的所有标题。结果如下:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:To s:mustUnderstand="1">https://pilot.eidverifier.com/uru/soap/ut/usv3</a:To>
<MORE SECURITY ELEMENTS...>
</s:Header>

https://pilot.eidverifier.com/uru/soap/ut/usv3
如您所见,“To”元素仍然存在。那么,我的问题是为什么?发送信息需要这些吗

我忍不住觉得我走错了路。有没有办法让你的理解是错误的?是否有删除所有额外元素的属性设置?我处于释放模式


非常感谢您的帮助或指导。

您使用了错误的
消息版本


要删除,请使用
Soap11
而不是
Soap11WSAddressing10

我应该补充一点,从Java服务返回的初始错误是:MustUnderstand头:[{}到,{}操作]未被理解。
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:To s:mustUnderstand="1">https://pilot.eidverifier.com/uru/soap/ut/usv3</a:To>
<MORE SECURITY ELEMENTS...>
</s:Header>