cancel
Showing results for 
Search instead for 
Did you mean: 

Execute Value Mapping into XSLT

Former Member
0 Kudos

Hi experts,

I'm executing an XSLT mapping where I need to get the user from a value mapping I've previusly created.

This is my XSLT:

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

<ns0:stylesheet version="1.0" xmlns:ns0="http://www.w3.org/1999/XSL/Transform" xmlns:trg="http://comsol-ag.com/xi/rfcxslt" xmlns:ns1="http://test/xi/tsts" xmlns:ValueMap="java:com.sap.aii.mapping.value.api.XIVMService">

<ns0:template match="/">

  <ns1:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">

   <ns1:Header>

    <ns2:ServiceAuthHeader xmlns:ns2="http://test.webservice.it/">

     <ns0:variable name="User" select="ValueMap:executeMapping('http://sap.com/xi/XI/SUPPLIERPORTAL','SP','USER','USER','http://sap.com/xi/XI/SUPPLIERPORTAL','SP','...')"/>

     <ns2:Username>

      <ns0:value-of select="$User"/>

     </ns2:Username>

     <ns2:Password>1234</ns2:Password>

    </ns2:ServiceAuthHeader>

   </ns1:Header>

   <ns1:Body>

    <ns0:copy-of select="*"/>

   </ns1:Body>

  </ns1:Envelope>

</ns0:template>

</ns0:stylesheet>

This is my Value Mapping:  

Context: http://sap.com/xi/XI/SUPPLIERPORTAL


Agency


Schema


Value

SPPASSPASS
SPPASS1234
SPUSERUSER
SPUSERuser1

And this is the error:

    Transformer Configuration Exception occurred when loading XSLT AddUserPass_v3.xsl;

    details: The first argument to the non-static Java function
    'executeMapping' is not a valid object reference.

See error logs

    for details

 

It seems that the error is in the first argument, but it is the context and it is correct.

Any ideas?

Thanks a lot.

Accepted Solutions (0)

Answers (3)

Answers (3)

Muniyappan
Active Contributor
0 Kudos

Dear Maria,

check this blog and look for value mapping

Regards,

Muniyappan

peter_wallner2
Active Contributor
0 Kudos

Hello Maria,

As far as I know you can only call "static" java functions from an XSLT mapping. That might be the issue.

Best regards,

Peter

iaki_vila
Active Contributor
0 Kudos

Hi Maria,

Your XSL code needs additional functions, check to understand which is necessary.

Regards.