Skip to Content
0

How to add the header content dynamically

Oct 25, 2016 at 12:39 PM

108

avatar image

Dear All,

As you know, the SOAP request include header and body tag. How to dynamically add the header in request for PI. The aim system need the account and password to verify. But the WebService doses not the element field.

auth.png

Could you please give me some advice? Thank you for your support in advance.

Many thanks & best regards,

Hubery

auth.png (75.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
avatar image
Former Member Oct 25, 2016 at 01:16 PM
2

Hi Hubery,

Use below XSLT mapping after your message mapping.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:template match="/">
      <soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
         <soap:Header>
            <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
               <wsse:UsernameToken>
                  <wsse:Username>User</wsse:Username>
                  <wsse:Password>Password</wsse:Password>
               </wsse:UsernameToken>
            </wsse:Security>
         </soap:Header>
         <soap:Body>
            <xsl:copy-of select="*"/>
         </soap:Body>
      </soap:Envelope>
   </xsl:template>
</xsl:stylesheet>

Or you can use soap with axis adapter as shown below blog.

How to Configure AXIS Framework for Authentication Using the “wsse” Security Standard in SAP PI

Regards,

Praveen.

Share
10 |10000 characters needed characters left characters exceeded
Hubery Yao Oct 25, 2016 at 01:54 PM
0

Thank you Praveen for your following. I will test and feedback.

Thanks again.

Best regards,

Hubery

Share
10 |10000 characters needed characters left characters exceeded
Hubery Yao Dec 06, 2016 at 02:50 AM
0

Dear Praveen,

Sorry for late reply. Thank you for your advice. The solution is OK.

Many thanks & best regards,

Hubery

Share
10 |10000 characters needed characters left characters exceeded