Skip to Content

How to Read SOAP Header Information

Although this is an old topic, I’ve continued to receive questions on this subject. The question is “how can I read the SOAP header elements in PI and use them in mapping?”

Then, the follow-up question always related to how do I write an user-defined function in Message Mapping to access those header information, which might be accessible through the Global Container object?

But, in fact, the solution is much simpler. No coding is required. It is merely a check in the SOAP communication channel configuration.

The SOAP sender communication channel gives us an option to send the complete SOAP XML, including the header. Then, we just need to construct a message type in the Enterprise Service Repository (ESR) or Integration Repository (IR) to represent the XML. With that, message mapping can be performed.

Let us use the example below.

By default, the communication channel configuration is below:


The XML of the SOAP message is below, when retrieved from SXBM_MONI in PI:


By making two changes we can send the complete XML of the SOAP message, including the header:

  1. Check the option, “Do Not Use SOAP Envelope”:


  2. Add “nosoap=true” to the SOAP’s WSDL URL:


As a result, the XML payload as seen in SXMB_MONI:


Reference: Configuring the Sender SOAP Adapter:

You must be Logged on to comment or reply to a post.
  • Could you also advise which format the sender applications needs to use to send message/queue IDs themselves by using the SOAP header? It is possible with using dynamic URLs, but there’s no detailed documentation on doing it with the header fields. Thanks in advance.


  • How did you generate a WSDL out of PI that includes a SOAP Header? And how did you structure your DT and MT to get that to work? Whenever I create a WSDL from the Sender Agreement, it puts the entire MT as the SOAP body and doesn’t allow for configuring the SOAP header.
    • One way is to use SoapUI, which you can download for free.  (Google SoapUI)  SoapUI is a test tool, which shows the complete SOAP envelope.


      • Thanks Bill. I’m familiar with SoapUI. I guess my question is, was the WSDL generated from within PI’s ID (i.e. off the Sender Agreement), or was the WSDL generated outside of PI?

        The particular scenario I’m researching currently is a SOAP -> PI -> SOAP, where the target web service provider requires SOAP header values. I initially was trying to create a WSDL out of PI that would be an exact copy of the true target WSDL, but I can’t find where a PI generated WSDL includes a SOAP Header definition.

  • hi william,
      thanks your great blog, i want to add soap header in the Webservice who is to be created by pi’s define webservice, i don’t how to do it,can you give me some advise?
    • Hi,
      Are you referring to the sender or receiver?  On the sender side, you can retrieve the header from the WSDL generated from the sender agreement.  On the receiver side, you can import the WSDL from the provider service; the header is defined in the WSDL.

      Within the header node, you can insert the custom elements, but do not change the existing contents.  Then, create the matching Message Types so you can use them in mapping.

      Since you will include your own header info, you will need to check the option “Do Not Use SOAP Enveope” in the communication channel configuration.


      • hi william,
          thank your reply,i want add soap header on the sender side,in your reply,about”Within the header node, you can insert the custom elements, but do not change the existing contents.”, i don’t know how to do, can you give me more detail advise
    • hi Willam,

        thanks your reply,on soap sender, i have solve the question which is add element to wsdl. pi generate wsdl file,i modify the wsdl to manual add soap header element,and check do not use soap envelope,i can read the header in the sxmb_moni payload.

  • Hello William,

    Sorry for adding comment after long time..

    My team is trying to following your blog. However, we are not sure if we need to modify Sender Interface to include Envelope / Header in the message structure itself.

    If we modify the message structure , it changes the WSDL as well and generating request message something like below :

    <soapenv:Envelope xmlns:soapenv=”” xmlns:aif=”urn://”>



          <aif:Envelope>   <——- Added by Modifying the structure







    How can we use  “Do not use SOAP Envelop” feature without modifying the WSDL structure?

    If we don’t modify the message structure , it is failing to identify the receiver and also we would not be able to see the fields while doing graphical mapping.

    Can you respond on this ?

    Thanks !!

      • Thanks William,

        I was able to use XSLT mapping in Sender communication channel which allowed me to use this option without modifying message structure.

        Dijesh Tanna

        • Hello Dijesh,

          We got similar requirement where we need to pass the date and time dynamically in receiver soap header, can you please guide us how we can achieve this…



  • Hi William,

    I want to conform one question whether this process can be used in both asynchronous and synchronous mode I got this doubt because you have told the changes only for the sender channel to access the header and what about the receiver channel.



    • Hi Avinash,

      This should work for both sync and async.  I have not tried it with the receiver channel, but I think you should also be able to do the same by using the HTTP adapter, but constructing the complete XML yourselve.



      • Hi Williams,

        Thanks for your reply it was working fine with the asynchronous scenario but while i am trying with the Synchronous scenario in SOAP UI it is only able to take the request in XML payload and giving response in XMLpayload but it is not able to take SOAP message if i give it in SOAP format it is throwing errors

        “ InterfaceDetermination did not yield any actual interface



        Please give any suggestions.