Administering Mediator : Mediator : REST to SOAP Transformation : Enabling XSLT and webMethods Integration Server Service Transformations
Enabling XSLT and webMethods Integration Server Service Transformations
As a provider of a REST-enabled SOAP API, you must enable XSLT or webMethods Integration Server Service for the API. A consumer who invokes the SOAP API using a SOAP request can directly add this information to the SOAP request in Mediator which is not possible in the case of a REST-enabled SOAP service. In the case of a REST request to a REST-enabled SOAP API, you must use the pg_isRestInvoke property to write your own XSLT or webMethods Integration Server Service for the API as shown in the following sample XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns :soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:esp="http://bms.com/esp" version="1.0">
<xsl:param name="pg _ isRestInvoke"/>
<xsl:template match="soapenv:Envelope">
<xsl:choose>
<xsl: when test="$pg_isRestInvoke = 'true'">
<soapenv:Envelope>
<soapenv:Header>
<yes></yes>
</soapenv:Header>
<soapenv:Body>
<!-Body Content for REST goes here->
</soapenv:Body>
</soapenv:Envelope>
</ xsl:when>
<xsl: otherwise >
<so apen v:Envelope>
<soapenv :Header>
<no></ no>
</soapenv:Header>
<soapenv:Body>
<!-Body Content for SOAP goes here->
</soapenv:Body>
</soapenv:Envelope>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Note:  
Mediator applies the XSLT and webMethods Integration Server Service transformations to a request only after converting the client's REST request to a SOAP request. Hence, you can apply these transformations to the SOAP request (obtained after converting the clients REST request) to modify the reqsuest as per your requirements.
Copyright © 2015- 2017 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback