Adding Header in SOAP Request

Hi All,

I am working on wM 9.9 and facing an issue with setting the header in soap request.
Client has shared their wsdl and we have created the connector in our server.

When posting the data, we need to set the header element as well which is not coming in the input document.

<soapenv:Envelope xmlns:soapenv=“” xmlns:com=“” >

<com:SalesOrderRequest >

The structure I am getting is SalesOrderRequest present in body only.
I am not sure how to set the header highlighted in RED above.

Please guide.


Did U try the header handler in web service descriptor and set the header
, as in page 84 in the guide.

try public service:

1 Like

Thanks Guys for the response.

Was able to create soap data and post it over HTTP using soap handler services.
Please refer below screenshot for sample code.


Hello Guys,

I am trying to do same thing our friend Amit has accomplished.
However, I generated my consumer based on WSLD. It turns out that, it added pub.client:soapClient.

I am not sure how to generate the same soap header attribute:


Perhaps, the lack of knowledge about the tool makes me little bit confused.

Can you please advise me,


Hey Amit,

Would you be able to let me know how did you format your SOAP data as input to these services.

I tried to do the same but values are not properly being formatted as SOAP message

Is it possible for you to send the sample code.Your response would behighly appreciated.

Arun Cholleti.

Hi guys,

I did a couple of posts some time ago that might help you:

They have screenshots and also attached resources (IS packages).

Give them a look.

Hi ,

I am facing similar issue while trying to add custom header .
I am creating a consumer by importing the wsdl , but the header information is not part of the wsdl

Create a header handler service , register it and call it from Consumer WSD .

You have information in this thread . or you can also refer the below mentioned thread as well .

Hi Vlad,First I follwed your tutorial and downloaded attached package,when I implement the same,for request handler I’m facing an issue that when I checked it “outputHeaderBlock[0]/headerDocument” is coming empty from “pub.soap.handler:getHeaderBlock”, I have followed exactly as you described in your site,Please help me on this (26.4 KB)

This was clarified offline.

Basically the XML namespace was missing from the header document type.

In case others have this problem. See attachment.