肥皂消息签名 [英] Soap message signing

查看:127
本文介绍了肥皂消息签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



美好的一天!



我正在努力向a发送一个肥皂请求服务器。我添加了提供的WSDL的服务引用。在将消息发送到服务器之前,我必须进行客户端身份验证和消息签名。我已经完成了客​​户端身份验证,请帮助我提供在将对象传递给wsdl生成的类时如何完成消息签名。



我是什么尝试过:



ServiceReference1.Purchaseclass proxy = new ServiceReference1.Purchaseclass();

ServiceReference1.getSuppliersRequest obj = new ServiceReference1 .getSuppliersRequest();

obj.companyId =345;

ServiceReference1.getSuppliersResponse response = new ServiceReference1.getSuppliersResponse();

ServicePointManager.Expect100Continue = true;

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; proxy.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.LocalMachine,StoreName.My,X509FindType.FindBySubjectDistinguishedName,test.mshq-client);

((BasicHttpBinding)proxy.Endpoint.Binding).Security .Mode = BasicHttpSecurityMode.Transport;

((BasicHttpBinding)proxy.Endpoint.Binding).Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;



//然后我必须在致电API请求之前发出消息标志



回复= proxy.GetSuppliers(obj);

Hi All

Good Day!

I am working on sending one soap request to a server. I have added the service reference of the WSDL provided. I have to make client authentication and message signing before the message send to the server. I have done the client authentication, kindly help me to provide how the message signing can be done while passing an object to the wsdl generated class.

What I have tried:

ServiceReference1.Purchaseclass proxy = new ServiceReference1.Purchaseclass();
ServiceReference1.getSuppliersRequest obj = new ServiceReference1.getSuppliersRequest();
obj.companyId = "345";
ServiceReference1.getSuppliersResponse response = new ServiceReference1.getSuppliersResponse();
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; proxy.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.LocalMachine, StoreName.My, X509FindType.FindBySubjectDistinguishedName, "‎test.mshq-client");
((BasicHttpBinding)proxy.Endpoint.Binding).Security.Mode = BasicHttpSecurityMode.Transport;
((BasicHttpBinding)proxy.Endpoint.Binding).Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;

// Then i have to make the message sign before calling the request to the API

response = proxy.GetSuppliers(obj);

推荐答案

查看服务器提供的文档。



如果您已正确完成身份验证,则会收到一组凭据以用于后续请求。将凭据与请求一起传递,如果正确完成,您看到的响应将是预期的数据响应。



除了更具体的细节之外,很难说什么是服务器期待。
Check the documentation provided by "a server".

If you have completed authentication correctly, then you received a set of credentials to use with your subsequent requests. Pass the credentials with the request, then if done correctly, the response that you are seeing will be the expected data response.

Beyond more specifics, it is difficult to say what "a server" is expecting.


这篇关于肥皂消息签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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