Richard Day

Richard Day

  • NA
  • 1
  • 0

Changing Namespace on a SOAP Header

Feb 21 2006 4:27 PM
I am calling a web service that is running on a Tomcat Server from a C# client.

The SOAP Header belongs to the a specific namespace http://www.abc.com/common
and the SOAP Body belongs to the namespace http://www.abc.com/message I am able to get the body elements to belong to the namespace, however, I am unable to specifiy a different namespace for the header that I am using.

I want the XML to look like this :

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Header>
     
<header xmlns="http://www.abc.com/common">
        
...
      </header>
   </soap:Header>
  
<soap:Body>
      <body xmlns="http://www.abc.com/message">
         ...
      </body>
  
</soap:Body>
</
soap:Envelope>

I can find plenty of example on how to get the same namespace for header & body elements but I cannot find information on how to make them different as detailed above.

Any help would be appreciated.