Skip to Content

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:

image

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

image

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”:

    image

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

    image

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

image

Reference: Configuring the Sender SOAP Adapter: http://help.sap.com/saphelp_nw04/helpdata/en/fc/5ad93f130f9215e10000000a155106/frameset.htm

To report this post you need to login first.

17 Comments

You must be Logged on to comment or reply to a post.

  1. S. Gokhan Topcu
    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.

    Regards,
    Gökhan

    (0) 
  2. Chris Williar
    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.
    (0) 
    1. William Li Post author
      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.

      Bill

      (0) 
      1. Chris Williar
        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.

        (0) 
  3. allen zhang
    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?
    (0) 
    1. William Li Post author
      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.

      Regards,
      Bill

      (0) 
      1. allen zhang
        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
        (0) 
    2. allen zhang
      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.

      (0) 
  4. Dijesh Tanna

    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=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:aif=”urn://transport.nsw.gov.au/test/poc/aif”>

      <soapenv:Header/>

      <soapenv:Body>

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

             <Header>

                <FileType>?</FileType>

             </Header>

             <Body>

                <BusinessPartner>

                   <!–Optional:–>

    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 !!

    (0) 
      1. Dijesh Tanna

        Thanks William,

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

        Regards,
        Dijesh Tanna

        (0) 
        1. NageswaraRao V

          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…

          Regards,

          Nagesh

          (0) 
  5. Avinash Ayanala

    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.

    Regards,

    Avinash

    (0) 
    1. William Li Post author

      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.

      Regards,

      William

      (0) 
      1. Avinash Ayanala

        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

        “com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.xi.routing.RoutingException: InterfaceDetermination did not yield any actual interface

          at com.sap.aii.adapter.soap.web.SOAPHandler.processSOAPtoXMB(SOAPHandler.java:743)

          at com.sap.aii.adapter.soap.web.MessageServlet.doPost(MessageServlet.java:470)………”

        Please give any suggestions.

        Regards,

        Avinash

        (0) 

Leave a Reply