Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Visual Studio 2010 project that consumes a number of services using System.ServiceModel

These services have now been altered to include the following security in the soap headers:
HTML
<wsse:security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
           <wsse:usernametoken wsu:id="UsernameToken-14" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
             <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">passsword</wsse:password>
           </wsse:usernametoken>
         </wsse:security>

I have been able to get the application to work by adding the information into the web.config file, but I would prefer to programmatically add it to the relevant services through code.

Does anyone know how this can be done through code?
Posted
Updated 23-Nov-11 2:56am
v2

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