Click here to Skip to main content
15,747,766 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have added a service reference to my Web Project by just creating an assembly and right clicking on it to "Add a service Reference..." now I just provide the WSDL path and created a service reference.

I am able to get all the method names and the parameter type from the object of this reference.Even I am able to successfully invoke the service.

For Example :
SecurityProcessHandler objProcessHandler = new SecurityProcessHandler();
string objReturn = objProcessHandler.getUserDataForLogin(objInput);

My problem is that I now need to add a header info to the request while invoking the service and the header info in SOAP format is as follows:


Now I don't know how to add a header info to my service call.
Is it possible to add header info to my service? I tried in google but with no success.

1 solution

I'm not sure if this is what you mean. But you can create a security token for the SOAP header via:

// Create the WS-Security token for the SOAP header
UsernameToken userToken = new UsernameToken(uid, pswd, PasswordOption.SendPlainText);
Share this answer

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