Click here to Skip to main content
15,889,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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);
Posted
Updated 1-Aug-17 21:34pm
v2

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900