Forum Discussion

jhnrpavan's avatar
jhnrpavan
New Contributor
12 years ago

How to add custom soap headers as part of soap envelope

Hello All,

i have a requirement in my application to pass headers from a tool(a job tool which runs continuously and hits the given endpoint with below soap request) in below format..

so along with body request i need to give the job tool .. the sutom headers as shown below.. what is the correct way that i can do that..

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.test.com/">
<soapenv:Header>
<ns1:AuthenticationInfo xmlns:ns1="urn:http://service.test.com/">
<ns1:UserName>Test UserName</ns1:UserName>
<ns1:Password>Test Password</ns1:Password>
</ns1:AuthenticationInfo>
<ns1:Custom_Header_1 xmlns:ns1="urn:http://service.test.com/">Custom_Header_1_Value</ns1:Custom_Header_1>
<ns1:Custom_Header_2 xmlns:ns1="urn:http://service.test.com/">Custom_Header_2_Value</ns1:Custom_Header_2>
</soapenv:Header>/
<soapenv:Body>
<ser:testOperationName>
<greeting></greeting>
</ser:testOperationName>
</soapenv:Body>
</soapenv:Envelope>