cancel
Showing results for 
Search instead for 
Did you mean: 

Remove SAP header from SOAP request

Former Member
0 Kudos

  Hello,

     In PI 7.3 using the SOAP adapter how do I remove the SAP header elements from the message?  In the Communication Channel I've unchecked the 'Keep Headers' option but I'm still seeing the SAP header elements in the output.

I see that PI is sending out the request which looks like this:

<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>

  <SOAP:Header>

    <sap:ReliableMessaging xmlns:sap='http://sap.com/xi/XI/Message/30' SOAP:mustUnderstand='1'>

      <sap:QualityOfService>ExactlyOnce</sap:QualityOfService>

    </sap:ReliableMessaging>

    <sap:DynamicConfiguration xmlns:sap='http://sap.com/xi/XI/Message/30' SOAP:mustUnderstand='1'>

      <sap:Record namespace='http://sap.com/xi/XI/Message/30/general' name='senderAgreementGUID'>bc55ba37f80c36e2839ed19016a8767c</sap:Record>

    </sap:DynamicConfiguration>

    <sap:HopList xmlns:sap='http://sap.com/xi/XI/Message/30' SOAP:mustUnderstand='1'>

      <sap:Hop timeStamp='2012-05-11T20:14:20Z' wasRead='false'>

        <sap:Engine type='AE'>af.xid.nasapdevpi</sap:Engine>

        <sap:Adapter namespace='http://sap.com/xi/XI/System'>XIRA</sap:Adapter>

        <sap:MessageId>de46d441-6a63-4391-0d91-95a4553018eb</sap:MessageId>

        <sap:Info></sap:Info>

      </sap:Hop>

      <sap:Hop timeStamp='2012-05-11T20:14:20Z' wasRead='false'>

        <sap:Engine type='IS'>is.00.NASAPDEVPI</sap:Engine>

        <sap:Adapter namespace='http://sap.com/xi/XI/System'>XI</sap:Adapter>

        <sap:MessageId>de46d441-6a63-4391-0d91-95a4553018eb</sap:MessageId>

        <sap:Info>3.0</sap:Info>

      </sap:Hop>

      <sap:Hop timeStamp='2012-05-11T20:14:20Z' wasRead='false'>

        <sap:Engine type='AE'>af.xid.nasapdevpi</sap:Engine>

        <sap:Adapter namespace='http://sap.com/xi/XI/System'>XIRA</sap:Adapter>

        <sap:MessageId>de46d441-6a63-4391-0d91-95a4553018eb</sap:MessageId>

      </sap:Hop>

    </sap:HopList>

    <sap:Diagnostic xmlns:sap='http://sap.com/xi/XI/Message/30' SOAP:mustUnderstand='1'>

      <sap:TraceLevel>Information</sap:TraceLevel>

      <sap:Logging>Off</sap:Logging>

    </sap:Diagnostic>

    <sap:System xmlns:sap='http://sap.com/xi/XI/Message/30' SOAP:mustUnderstand='1'/>

    <sap:Main xmlns:sap='http://sap.com/xi/XI/Message/30' versionMajor='3' versionMinor='1' SOAP:mustUnderstand='1'>

      <sap:MessageClass>ApplicationMessage</sap:MessageClass>

      <sap:ProcessingMode>asynchronous</sap:ProcessingMode>

      <sap:MessageId>de46d441-6a63-4391-0d91-95a4553018eb</sap:MessageId>

      <sap:TimeSent>2012-05-11T20:14:20Z</sap:TimeSent>

      <sap:Sender>

        <sap:Party agency='' scheme=''></sap:Party>

        <sap:Service>BS_CD1</sap:Service>

      </sap:Sender>

      <sap:Receiver>

        <sap:Party agency='' scheme=''></sap:Party>

        <sap:Service>BS_PROTEXIS_DEV</sap:Service>

      </sap:Receiver>

      <sap:Interface namespace='urn:sage.com:protexisactivations'>SI_ProtexisActivation_WS_Test_Async_In</sap:Interface>

    </sap:Main>

  </SOAP:Header>

  <SOAP:Body>

    <ns1:DataRequest xmlns:ns1='https://license.ntitles.net/soap/message/'>

      <CustomerID>xxx</CustomerID>

      <Username>xxx</Username>

      <Password>xxx</Password>

      <RequestXML>&#60;DataRequest Type='Activation'&#62;&#60;Filter Field='TimeStamp' Type='Range' From='20120417060700' To='20120417062700'/&#62;&#60;/DataRequest&#62;</RequestXML>

    </ns1:DataRequest>

  </SOAP:Body>

</SOAP:Envelope>

The receiving system doesn’t like the header so I want to make PI stop sending the SAP Header elements so that the output looks like this with empty header:

<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>

  <SOAP:Header>

  </SOAP:Header>

  <SOAP:Body>

    <ns1:DataRequest xmlns:ns1='https://license.ntitles.net/soap/message/'>

      <CustomerID>xxx</CustomerID>

      <Username>xxx</Username>

      <Password>xxx</Password>

      <RequestXML><![CDATA[<DataRequest Type='Activation'><Filter Field='TimeStamp' Type='Range' From='20120417060700' To='20120417062700'/></DataRequest>]]></RequestXML>

    </ns1:DataRequest>

  </SOAP:Body>

</SOAP:Envelope>

Thanks,

Noel

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Dear Noel

Your screenshot shows you have not checked "Do not keep soap envelope"

check it.

Regards

Monika

baskar_gopalakrishnan2
Active Contributor
0 Kudos

PI uses its own message protocol PI SOAP for its internal message processing during pipeline steps. This message header what you have shown in the above screenshot will not be sent for the customer. As you know SOAP envelope contains soap header + Body, If you dont want soap header but still requires soap envelope, you have to remove just soap header part using java mapping.  Otherwise as greg pointed out choose do not use soap envelope.

Former Member
0 Kudos

Hi Bhaskar,

I am trying to to remove soap header from sender soap communication channel choosing do not use soap envelope but i am getting below error.

SOAP: call failed com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.NullPointerException: while trying to invoke the method com.sap.engine.interfaces.messaging.api.XMLPayload.getInputStream() of an object returned from com.sap.aii.adapter.xi.ms.XIMessage.getDocument()

Please help me on this to resolve this issue.

Thanks in advance,

Mohit

anupam_ghosh2
Active Contributor
0 Kudos

Hi Mohith,

                  Are you sure that the receiver system expects xml like this


<SOAP:Envelopexmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>

  <SOAP:Header>

  </SOAP:Header>

  <SOAP:Body>

    <ns1:DataRequest xmlns:ns1='https://license.ntitles.net/soap/message/'>

      <CustomerID>xxx</CustomerID>

      <Username>xxx</Username>

      <Password>xxx</Password>

      <RequestXML><![CDATA[<DataRequest Type='Activation'><Filter Field='TimeStamp' Type='Range' From='20120417060700' To='20120417062700'/></DataRequest>]]></RequestXML>

    </ns1:DataRequest>

  </SOAP:Body>

</SOAP:Envelope>


This has the envelop in place but soap header blank nodes are present.

If this is the expectation then "do not use Soap envelop" option will not work here. Please confirm the same after testing with SOAP UI tool.

Regards

Anupam

Former Member
0 Kudos

Hi Gosh,

Client will send the data along with header (mandatory with all outbound messages) and they say we can  remove the header in PI. so we decided to remove header details. The option is to call xslt/java mappings or may be custom module I believe.

Is there any other workarounds we can do on this? or can you please help if you have any java code which will work for this. I am not good in Java.

Please find the attached file, you can see header data is coming in the request payload. which has special character (AT&amp). can you please help if you have time.

Thanks,
Mohith.

nitindeshpande
Active Contributor
0 Kudos

Hi Mohith,

For this requirement you can use Custom Adapter Module suggested in the below blog -

Regards,

Nitin

former_member184681
Active Contributor
0 Kudos

Hi Noel,

I think you could only do this by marking the "Do Not Use SOAP Envelope" checkbox in the communication channel attributes, and generating the SOAP Header yourself during mapping.

Regards,

Greg

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Noel,

You confused with Web service message header with PI message header

To include the header of the Web service message in the XI message selectKeep Headers else uncheck this in SOAP receiver adapter

keep headers options will not work one XI message header, PI system forever message it will genarate SOAP header which contains System genarated information, this is not going effect anything .

What problem are you facing?

Best Regards,

Raj