I have some trouble in trying to consume a function from this webservice https://84.199.99.213:8443/XWS/services
For example and I insert this header into the envelope, I have access to all the functions. But in my C# code, whatever method I tried I got the Unauthorized Error or this exception saying headers are not understood.
<SOAP-ENV:Header>
<Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<UsernameToken xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' >
<Username>###</Username>
<Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'>###</Password>
</UsernameToken>
</Security>
</SOAP-ENV:Header>
Here is the authentication sequence and trying to consume a function in my C# project:
// Create the binding.
WSHttpBinding myBinding = new WSHttpBinding();
myBinding.Security.Mode = SecurityMode.Transport;
myBinding.Security.Transport.ClientCredentialType =
HttpClientCredentialType.Basic;
// Create the endpoint address.
EndpointAddress ea = new EndpointAddress("https://84.199.99.213:8443/XWS/services/cardservice");
// Create the client.
ServiceReference1.CardServiceClient cc =
new ServiceReference1.CardServiceClient(myBinding, ea);
// User name and password.
cc.ClientCredentials.UserName.UserName = "###";
cc.ClientCredentials.UserName.Password = "###";
// Open the client.
cc.Open();
//Consume a function
ServiceReference1.lookUpItem[] x = cc.listTariffs(null);
rtbOutput.Text= x.Length.ToString();
What should I have into app.config in order to make it work? Or is something else that I'm missing?
Is anyone able to help me out, please?
Thanks in advance