Skip to Content
0

XSLT Code with parameterized mapping

Jan 19, 2017 at 08:11 AM

87

avatar image
Former Member

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

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

4 Answers

Iñaki Vila Jan 19, 2017 at 08:53 AM
1
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 19, 2017 at 01:12 PM
0

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

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

Mani,

Did you select

use SAP XML Toolkit in the OM?

Also please share the Java code.

0
Evgeniy Kolmakov Jan 20, 2017 at 08:24 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 23, 2017 at 01:13 PM
0

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

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

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.

1

Yes MAndeep,Kindly share the changes you have done.

0