Monday, 26 August 2013

Proper binding configuration for web service with plaintext password

Proper binding configuration for web service with plaintext password

I am trying to make a web service client in .NET. I add service reference
and Visual Studio create following binding:
<bindings>
<basicHttpBinding>
<binding name="sample" />
</basicHttpBinding>
</bindings>
but I am getting q0:FailedAuthentication.
I found that I am getting results in soapUI only when I set WSS_TYPE to
PasswordText.
Do you know how to set binding configuration in .NET/WCF to get the same
request?
Below is soapUI request:
<soapenv:Envelope xmlns:rnl="sample"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-3">
<wsse:Username>username</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
<wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">XXXX</wsse:Nonce>
<wsu:Created>date</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<rnl:GetLastUpdate/>
</soapenv:Body>
</soapenv:Envelope>

No comments:

Post a Comment