Skip to Content
avatar image
Former Member

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


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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Sep 29, 2015 at 12:07 PM

    Hi Jagdish,

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

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 29, 2015 at 12:15 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 29, 2015 at 01:01 PM

    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>

    Add comment
    10|10000 characters needed characters exceeded