I need to add to my message something like this:
<soap:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="unt_Z1k4LnxEmBzzKuPP">
<wsse:Username>user</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">iNs+LF1iwwPU2AMer8uU6NKY9tfzgYqMTaP3mIEgoK0=</wsse:Nonce>
<wsu:Created>2012-04-22T11:57:30Z</wsu:Created>
</wsse:UsernameToken>
<wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Created>2012-04-22T11:57:30Z</wsu:Created>
<wsu:Expires>2012-04-22T11:58:30Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
I'm calling a web service which return a 500 error response which basically means it cannot authenticate I guess cause I'm missing these information from the message, even I have an authentication header on the message. Can this be happening?
How can I add the WS-Security header in the message and add all these info in code? I added the service using Add Web Reference in Visual Studio.
Thank you.