cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT Code with parameterized mapping

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

iaki_vila
Active Contributor
Former Member
0 Kudos

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

iaki_vila
Active Contributor

Hi Mandeep,

Please comment the final solution of your last problem and the key XSL instructions that you have written. In this way you can help more scn members in the future 🙂

Regards.

former_member186851
Active Contributor
0 Kudos

Yes MAndeep,Kindly share the changes you have done.

former_member190293
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

former_member186851
Active Contributor
0 Kudos

Mani,

Did you select

use SAP XML Toolkit in the OM?

Also please share the Java code.