WCF例外 - 的“身体”,“http://www.w3.org/2003/05/soap-envelope”所需的消息部分没有签名。问题 [英] WCF Exception - The 'Body', 'http://www.w3.org/2003/05/soap-envelope' required message part was not signed. Issue

查看:422
本文介绍了WCF例外 - 的“身体”,“http://www.w3.org/2003/05/soap-envelope”所需的消息部分没有签名。问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地运行一个WCF客户端总是抛出带有文本MessageSecurityException:
无抵押或担保不正确的故障从对方收到。请参阅故障code和细节在内的FaultException。

I'm running a WCF client locally that always throws a MessageSecurityException with the text: "An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail."

内部异常消息是:
的消息验证的安全性时发生错误

我设置了​​一个跟踪,并在该文件中,我可以看到内内异常消息为:
的'身体',' http://www.w3.org/2003 / 05 / SOAP信封所需的消息部分没有被签署。

I set up a trace and in that file I can see the "inner inner" exception message as: "The 'Body', 'http://www.w3.org/2003/05/soap-envelope' required message part was not signed. "

该绑定客户,并与他们全部使用NetTcpBinding的与SECURITYMODE =消息服务之间的所有完美匹配

The bindings all match perfectly between the client and the service with them all using netTcpBinding with the securityMode="Message".

标记了ServiceContract装饰服务背后的接口是:

The ServiceContract decorating the interface behind the service is:

 [ServiceContract(ProtectionLevel = ProtectionLevel.None)]

什么引起我的错误?我不是专家WCF,所以我,如果你需要的信息不再只是发表评论。什么尝试会有帮助过任何想法,我只是不知道怎么回事就在这里。

What could be causing my errors? I'm no WCF expert so I if you need anymore information just comment. Any ideas on what to try would be helpful too, I just have no idea whats going on here.

推荐答案

默认情况下,所有的消息都签署并于WCF加密,到底为什么你想把它们关掉?

By default, all messages are signed and encrypted in WCF, and why on earth would you ever want to turn that off??

因此​​,在这种情况下,最有可能的,你的客户端加密和签名的消息,但服务器不理解,因为该服务合同的属性吧。

So in this case, most likely, your client has encrypted and signed the message, but the server doesn't understand it because of your attribute on the service contract.

我的建议:除非你有一个非常有说服力的理由,从来不篡改和更改这些设置 - 忘掉你的服务,属性,并保留默认值:

My recommendation: unless you have a very compelling reason, never tamper and change those settings - just forget about that attribute on your service and leave the defaults:

[ServiceContract(ProtectionLevel = ProtectionLevel.EncryptAndSign)]

[ServiceContract]

如果你真的要关闭它,你需要关闭它在通话双方 - 客户端和服务器必须达成一致的消息是否被加密和签名

If you really have to turn it off, you need to turn it off on both sides of the conversation - both the client and the server must agree on whether or not messages are encrypted and signed.

马克

这篇关于WCF例外 - 的“身体”,“http://www.w3.org/2003/05/soap-envelope”所需的消息部分没有签名。问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆