Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding value to SOAP header

Status
Not open for further replies.

NotMyRealName221

Programmer
Oct 28, 2008
8
US
This is my code, inside a SOAP Extension:

Code:
    public void AddSessionId(SoapMessage message)
    {
        myHeader SessionHead = new myHeader();
        SessionHead.SessionId = _SessionId + "|" + _Sequence;
        message.Headers.Add(SessionHead);
    }
    public class myHeader : SoapHeader
    {
        public string SessionId;
    }

obviously not the complete listing but you get the idea. That is creating this SOAP header:
Code:
<soap:Header><myHeader><SessionId>H8SDF876|0</SessionId></myHeader></soap:Header>

What I want is:
Code:
<soap:Header><SessionId>H8SDF876|0</SessionId></soap:Header>

I can change the name of custom header class from myHeader to SessionId that will change the first tag, but then I want to set the value directly rather than have another tag inside it. How would I do that?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top