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.

e.g.
<soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:com=“http://www.xyz.com” >
soapenv:Header
ABC11
</soapenv:Header>

soapenv:Body
<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.

Thanks,
Amit

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

http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite9-9/Integration_Server/9-9_Web_Services_Developers_Guide.pdf

try public service:
WmPublic/pub.soap.handler:addHeaderBlock

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.

Thanks,
Amit
SoapHTTP.JPG

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:

soapenv:Header
ABC11
</soapenv:Header>

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

Can you please advise me,

Regards

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.

Thanks,
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 .

http://tech.forums.softwareag.com/techjforum/posts/list/57349.page

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
AAWS.zip (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.

1 Like