Click here to Skip to main content
13,046,464 members (73,845 online)
Rate this:
Please Sign up or sign in to vote.
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 :
[__b__]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.
Posted 17-Dec-12 2:32am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 17 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100