如何签订WCF SOAP请求 [英] How to sign a SOAP request with WCF

查看:142
本文介绍了如何签订WCF SOAP请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个第三方的SOAP Web服务。我需要调用它的方法之一。该请求需要签名。我如何签名的请求?

I have an 3rd party SOAP web service. I need to make a call to one of its methods. The request needs to be signed. How can I sign the request?

推荐答案

我想通过签署你的意思是,你使用安装在客户端的证书签名邮件。

I assume by signing you mean that you sign the message using a certificate that is installed on the client side.

这样做是在WCF中相对容易。假设你使用的是的wsHttpBinding 中的安全元素你必须将模式设置为<一个href="http://msdn.microsoft.com/en-us/library/system.servicemodel.securitymode.aspx">SecurityMode.Message.您还可以设置邮件元素以<一的 clientCredentialType href="http://msdn.microsoft.com/en-us/library/system.servicemodel.messagecredentialtype.aspx">MessageCredentialType.Certificate.

Doing this is relatively easy in WCF. Assuming you are using the wsHttpBinding in the security element you have to set the mode to SecurityMode.Message. You also have to set the clientCredentialType of the message element to MessageCredentialType.Certificate.

那么,你就必须建立一个终结点行为,并配置 clientCertificate元素(这是 clientCredentials元件的)的子以指示客户端证书被存储。

Then, you would have to set up a endpoint behavior and configure the clientCertificate element (which is a child of the clientCredentials element) to indicate where the client certificate is stored.

即使你不使用的wsHttpBinding,当你想使用一个客户端证书,提供消息级安全配置是pretty的几乎相同的其他大多数绑定。

Even if you aren't using the wsHttpBinding, the configuration is pretty much the same for most of the other bindings when you want to use a client certificate to provide message-level security.

如果你正在调用通过HTTPS,那么请注意,您必须将安全元素的mode属性设置为Mode.TransportWithMessageCredential。

If you are making the call over HTTPS, then note that you will have to set the mode attribute on the security element to Mode.TransportWithMessageCredential.

这篇关于如何签订WCF SOAP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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