http Headers in SOAP calls

Is there a way to edit/pass variables in httpHeaders through pub.client.soapClient?
I need to pass two variables in the http header. Is there any other way to accomplish this.

The WSD generated from the WSDL consumed uses a pub.client.soapClient but I dont see any option to add http Headers in it.

I am using WM7.1.1 and consuming a webservice.

Thanks in advance,

Ravi, I am not sure what do you mean by soapClient service.
But you can pass HTTP headers through pub.client.soapHTTP service.

While invoking soapHTTP service, add a document named “header” in the Pipeline In and append name-value pairs for the variables you want to pass in that document. The soapHTTP service will recognize it as HTTP header and pass it as header information.

Hope this helps. It worked for me. Let us know if it works for you.

It seems like WM 7.1.1 uses pub.client.soapClient service ( as an equivalant for the combination of createSoapData and soapHTTP in WM 6.1 )

As you suggested I tried in WM 6.1 which has the soapHTTP service call. Once I create a document named ‘header’ with two string variables where do I need to link the document to in the ServiceInput?
I also tried creating the ‘header’ document with variables and hardcode them in ‘Servie In’ of soapHTTP but no luck.

So could you please explain me in detail what you have done and on what version.

Is there a way I can see the populated HTTP header infomation in WM?

No need to map header document to anything. Populate it and keep in the pipeline. soapHTTP service will recognize it. You can use tools like tcpTrace/tcpMonitor to see the header information.

It should work.

Hi dhimate,
I tried this.
Before the call to pub.client.soapHTTP
Placed a Map step
In the output of the map step Created a document named ‘header’ with 2 string variables(username, password) in it and hardcoded the values.

The next step is pub.client.soapHTTP

After invoking the soapHTTP when I check the variables in the Results
I dont see the variables I pass in the header.
There are several other variables showing up ike

Status Message

I dont see the variables(username, password) that I passed in.
Please help

My bad. The document name should be “headers” and not “header”. Just add the document with the subfields as username and password. Don’t map it to anything. It will appear in the HTTP header. See the attachment for reference. (69.2 KB)

Thanks dhimate!!!
It worked in 6.1 but not working in 7.1 with pub.client:soapClient. I will research on it.

How did you know that there is such an input called ‘headers’ which soapHTTP recognizes ??? Will it be in the documentation somewhere?
Let me know, so that It helps me research on pub.client.soapClient

Once again thanks a lot!!!

Someone told me about this. I haven’t seen anything like this in documentation. Great it helped.