Adding Soap Header

GrexD

Well-known member
Joined
Mar 5, 2008
Messages
95
Programming Experience
Beginner
I received a WSDL from a company so I can access their service. In testing with them they supplied me with a request which has <soap:Header><con:Context> (see below), which I copied and pasted in to soapUI for testing. Most of the elements must be populated or the request fails. After testing they supplied me with a WSDL which only has the body and does not have the header. I tried adding it to the WSDL, but either I did it wrong (first time working on a WSDL like that) because anything above the <soap:Body> does not show up as an object in VS 2010 when the WSDL is loaded as a service reference. I was able to add it to part of payLoad, but the request still failed, as I thought it would.

I contacted the developer and they said they would not change the WSDl and couldn't understand why I didn't just add the header to the envelope (Java programmers). I had them remote in to show them the way VS works with this and they had never seen that before. They suggested I figure out how to make a soap request over https. I would need to do this with a cert. I have the app.cofig set for the endpoint with a cert.

Is there a way for me to add the header to the soap envelope before it leaves my app or will I need to figure out how to do it by building my own soap envelope and not user the native Service Reference objects in VS.

Any help is appreciated.

Greg

Request for testing
VB.NET:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:sear="http://service.webservices.mcp.wellpoint.com/Search_MCPClaims" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://wellpoint.com/esb/context" xmlns:head="http://wellpoint.com/esb/header">
   <soap:Header>
      <con:Context>
         <con:domainName></con:domainName>
         <con:srvcName></con:srvcName>
         <con:srvcVersion></con:srvcVersion>
         <con:operName></con:operName>
         <con:operVersion></con:operVersion>
         <con:senderApp></con:senderApp>
         <con:clientReqId/>
         <con:transId/>
         <con:esbReqId/>
         <con:msgTyp></con:msgTyp>
      </con:Context>
   </soap:Header>
   <soap:Body>
      <sear:Search_MCPClaimsMCPRequest>
         <sear:PayLoad>
            <sear:EBSRequest>
               <sear:ClinicalService_Request>
                  <sear:memberId></sear:memberId>
                  <sear:firstName></sear:firstName>
                  <sear:lastName></sear:lastName>
                  <sear:birthDate></sear:birthDate>
                  <sear:startDate></sear:startDate>
                  <sear:endDate></sear:endDate>
                  <sear:reportRequested></sear:reportRequested>
                  <sear:sensitiveCode></sear:sensitiveCode>
               </sear:ClinicalService_Request>
            </sear:EBSRequest>
            <sear:EBSHeader>
               <sear:clientID></sear:clientID>
               <sear:appID></sear:appID>
               <sear:serviceID></sear:serviceID>
            </sear:EBSHeader>
         </sear:PayLoad>
      </sear:Search_MCPClaimsMCPRequest>
   </soap:Body>
</soap:Envelope>
 
Top Bottom