hello,
allow me to explain my case , I have mpgw with json in input and json as output
I checked the json http header named by " id " in case matches, the message will be passed to the provider while if its not match json response will be printed and request will be rejected. try to test the second scenario and then I got rejected when it's not match but the response is client error as xml
the provided stylesheet is included below
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dp="http://www.datapower.com/extensions" xmlns:json="http://www.ibm.com/xmlns/prod/2009/jsonx">
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:param name="ID" select="3"/>
<xsl:variable name="id" select="dp:http-request-header('ID')"/>
<xsl:template match="/">
<xsl:variable name="match" select="ID=$id"/>
<xsl:choose>
<xsl:when test="$match">
<MESSAGE>Pass</MESSAGE>
</xsl:when>
<xsl:otherwise>
<json:object>
<json:string name="Description">Unauthorized</json:string>
</json:object>
<dp:reject/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
output is
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<env:Fault>
<faultcode>env:Client</faultcode>
<faultstring>(from client)</faultstring>
</env:Fault>
</env:Body>
</env:Envelope>
Transformation action reads from context var and output to null
#DataPower#Support#SupportMigration