Skip to Content
avatar image
Former Member

XSLT Code with parameterized mapping

Hi All,

I working on a requirement where I am generating SOAP Envelope for WSSE security and hard coding the username and pwd for security setting check via xslt code.This code is taking the input xml in SOAP body and adding SOAP envelope.

Now the requirement is to make the user id and pwd dynamic with using parameterized mapping.

Can anyone help me in achieving the requirement via XSLT parameterised code.

Thanks,

Nida

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jan 19, 2017 at 08:53 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 19, 2017 at 01:12 PM

    Hi Inaki,

    I have tried this blog and written my java code but failure is coming in XSLT code.

    The first argument to the non-static Java function getValue is not a valid object reference., javax.xml.transform.TransformerConfigurationException: The first argument to the non-static Java function getValue is not a valid object reference.

    My xslt code:

    <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:javamap="java:DynamicUserNameandPassword.CreateDynamicWSSE" > <xsl:param name="inputparam"/> <xsl:template match="/"> <soapenv:Envelope xmlns:ns="http://www.sabrix.com/services/customermanagementservice/2011-05-27" xmlns:ns1="http://www.sabrix.com/services/domainmodel/2011-05-27" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header> <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:UsernameToken wsu:Id="UsernameToken-2" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:Username> <xsl:value-of select="javamap:getValue($inputparam,USERNAME)" /> </wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Pass@123</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body> <xsl:copy-of select="*"/> </soapenv:Body> </soapenv:Envelope> </xsl:template> </xsl:stylesheet>

    Please guide.

    Regards,

    Mani

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 20, 2017 at 08:24 PM

    Hi Manideep!

    You can get access to Dynamic Configuration directly from XSL transformation:

    https://help.sap.com/saphelp_nwpi71/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/content.htm

    You just need to use simple java mapping before your XSLT mapping which moves input parameters to Dynamic Configuration.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 23, 2017 at 01:13 PM

    Thanks to all for helping me. We have achieved it by Dynamic configuration UDF and XSLT mapping.

    Add comment
    10|10000 characters needed characters exceeded