cancel
Showing results for 
Search instead for 
Did you mean: 

how to include Soap header with username & pwd in the receiver webservices

venkatasap
Participant
0 Kudos


Hi SapAll.

I have a requirement where I need to pass username & pwd in the main payload for IDOC to webservice Interface. iam using graphical mapping to map the IDOC with webservice data.

in the receiver SOAP Channel I have enabled the Keep Headers option but that doesn't help me.

can any one help me in this.

Regards.

Jagdish.

Accepted Solutions (0)

Answers (3)

Answers (3)

arrezende
Active Participant
0 Kudos

I had the same "problem", and in this case had to change configuration of Module parameter in communication channel and create xsl mapping.

Here's how I set up CC...

And an example of XSL...

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://xmlns.sap.com/example" xmlns:ns0="http://xmlns.sap.com/">

  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />

  <xsl:template match="node() | @*">

  <xsl:copy>

  <xsl:apply-templates select="node() | @*" />

  </xsl:copy>

  </xsl:template>

  <!-- Change user of XML -->

  <xsl:template match="/ns0:Header/ns0:TransmissionHeader/ns0:UserName">

  <ns0:UserName>userapp</ns0:UserName>

  </xsl:template>

  <!-- Change password of XML -->

  <xsl:template match="/ns0:Header/ns0:TransmissionHeader/ns0:Password">

  <ns0:Password>password</ns0:Password>

  </xsl:template>

</xsl:stylesheet>

venkatasap
Participant
0 Kudos

Hi.

I have never created XSLT Mapping . can you help me in telling what tools I need for implementing XSLT mapping.

Regards.

Jagdish.

arrezende
Active Participant
0 Kudos

You have the output of your XML mapping and XML to be sent to the webservice (envelope soap) ?

So we can guide you how to create this XSL ...

former_member186851
Active Contributor
0 Kudos

Hello Jagadish,

You can use altova xml or even notepad to write XSLT mapping.

Save it zip and import in ESR and use it in operation mapping,after message mapping for your case.

Refer the below link

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/000ee4d0-be91-2d10-8aaf-ff8045bdd...

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Jagdish,

Refer the below links on xslt mapping.

http://www.riyaz.net/sap/beginners-guide-to-xslt-mapping-in-sap-pi/769/

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Jagdish,

I echo with inaki, you need to explicitly add the header information in the payload.

If you want to do it in the channel level, you can do it using the module or else you can do it using xslt mapping at the mapping level.

Refer the below links:

https://scn.sap.com/thread/1936972

How to add a soap header in the mesage | SCN

iaki_vila
Active Contributor
0 Kudos

Hi Jagdish,

You can use a XSLT mapping to do it, also you have a standard module adapter

Regards.

venkatasap
Participant
0 Kudos

Hi Inaki Vila.

I have configured the Adapter module in the Receiver communication  channel but still I cont. see the header in the Payload.

I also want to know of how the data will look like in the moni & where exactly I can see the header in the MONI Payload.

Regards.

Jagdish.

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Jagish,

Since the adapter module present in the channel level, you cannot see this header in the payload level in either moni or RWB.

You need to check with the webservice team.

But if you want to see how the payload looks like after the AddSoapheader module, then you can check by using Message logger bean in the channel exactly after the AddSoapHeader module.

former_member186851
Active Contributor
0 Kudos

Hello Jagish,

You can do using XSLT/Java Mapping as well.