Skip to Content

xslt mapping with java - set value header in soap receiver

May 16, 2017 at 09:07 PM


avatar image

Hi Expert,

I want to send user and pass in the header to soap receiver, but it does not work.

I have created the following xslt mapping

	<xsl:stylesheet version="1.0" xmlns:xsl=""
	<xsl:output method="xml" encoding="utf-8" indent="no"/>	
	<xsl:param name="inputparam"/>
	<xsl:template match="/">
		<xsl:variable name="dynamic-conf"  
        select="map:get($inputparam, 'DynamicConfiguration')" />
		<xsl:variable name="dynamic-key"   
			select="key:create('', 'XHeaderName1')" />
		<xsl:variable name="dynamic-value" 
			select="dyn:get($dynamic-conf, $dynamic-key)" />
		<xsl:variable name="new-value"     
			select="concat($dynamic-value, 'admin')" />
		<xsl:variable name="dummy" 
			select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" /> 
		<xsl:variable name="dynamic-key1"   
			select="key:create('', 'XHeaderName2')" />
		<xsl:variable name="dynamic-value1" 
			select="dyn:get($dynamic-conf, $dynamic-key1)" />
		<xsl:variable name="new-value1"     
			select="concat($dynamic-value1, 'admin')" />
		<xsl:variable name="dummy1" 
			select="dyn:put($dynamic-conf, $dynamic-key1, $new-value1)" /> 			
	<soapenv:Envelope xmlns:soapenv="" xmlns:tem="">
		<xsl:copy-of select="*" />

In the communication channel, I have marked "Do not use SOAP Envelope" and "Keep Headers"

And Activated ASMA

I have marked the option "Use SAP XML Toolkit" in OM

When I run no error appears in sxi_monitor, and generates the following xml without tag header:

But "DynamicConfiguration" is OK.

Finally the response from the webservice indicates that neither user nor paaword has been sent:

Any help will be highly appreciated.

Regards, Joel

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

avatar image
Former Member May 17, 2017 at 04:42 AM


Your username and password is static or it will vary?



10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov May 17, 2017 at 07:45 AM

Hi Joel!

If your header elements are static you can use AddSOAPHeaderBean to add it to message header:

Otherwise you should manually construct Header section of SOAP message in your XSL transformation. That's what you set parameter "Do not use SOAP Envelope" for.

Something like this:

<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:template match="/">
<soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd="">
<ServiceAuthHeader xmlns="http://WIND.WEBSERVICES.DMS/">
<xsl:copy-of select="*"/>

Regards, Evgeniy.

10 |10000 characters needed characters left characters exceeded
Joel Jáuregui Hernández May 17, 2017 at 08:39 AM


Thank you for answering me, when it is static if it works, but the values must be variable and sent from the abap proxy.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Joel!

In this case you could use XSL transformation as shown above.

Besides this, SOAP Axis adapter supports header insertion.

Regards, Evgeniy.