M
M
Michael2016-09-22 14:27:04
SOAP
Michael, 2016-09-22 14:27:04

How to set WSS-PasswordType for SOAP client?

Good afternoon!
I'm trying to connect to a web service running on soap. wsSecurity is enabled on the server.
I do

BasicHttpBinding binding = new BasicHttpBinding();
                binding.SendTimeout = TimeSpan.FromSeconds(25);
                binding.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.TransportCredentialOnly;
                binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Digest;
                binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;                

                EndpointAddress address = new EndpointAddress("http://....");

                Service.Providers client = new Service.Providers(binding, address);
                var rsp = client.sendXML();

I get the error javax.xml.transform.TransformerException: Unable to evaluate expression using this context
Through soapUI everything works. If you set WSS-Password Type to PasswordDigest
How to implement this in code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2016-09-29
@Slider_vm

Here is the solution that helped -> https://benpowell.org/supporting-the-ws-i-basic-pr...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question