cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a soap header in the mesage

0 Kudos

Hi expert:

We have a problem about this synchronous scenario: ECC(ABAP Proxy)>PI>P6(SOAP), In P6,it need additional soap header as below:

<soapenv:Header>

<wsse:Security mustUnderstand="0" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">

<wsse:UsernameToken wsu:Id="UsernameToken-5700630" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">

<wsse:Username>admin</wsse:Username>

<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">admin</wsse:Password>

</wsse:UsernameToken>

</wsse:Security>

</soapenv:Header>

How can i add this header to the receiver message?

Accepted Solutions (1)

Accepted Solutions (1)

former_member854360
Active Contributor
0 Kudos

Hi,

You can use JAVA or XSLT mapping to achive this.

refer this

http://knbintegration.com/blog/?p=181

Or

The axis adapter comes with a convenient header insertion handler where you can insert an arbitrary header using a template.

Answers (3)

Answers (3)

0 Kudos

Thank you for everyone,I have solved this problem

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi,

Can you please let me know how did you solve the issue?

Regards,

Akshay

surya_rudraraju
Discoverer
0 Kudos

Hi

Create an XSL file like below and use in your mapping.

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:template match="/">

<soapenv:Header>

<wsse:Security mustUnderstand="0" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">

<wsse:UsernameToken wsu:Id="UsernameToken-5700630" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">

<wsse:Username>admin</wsse:Username>

<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">admin</wsse:Password>

</wsse:UsernameToken>

</wsse:Security>

</soapenv:Header>

<xsl:copy-of select=""/>*

</xsl:template>

</xsl:stylesheet>

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>How can i add this header to the receiver message?

You want custom header. So check the option "Do not use Envelope" in the soap receiver channel. You can create soap header using Java or XSLT mapping. You need web service security features like Username token so better go with Java mapping. Refer Apache Axis open source API for coding. If the requirement is simple and the values are pretty static then go with XSLT mapping.