ContributionsMost RecentMost LikesSolutionsXSLT to route single reuest to multiple endpoints based on URI Hi, I want to route to specific endpoints if the incoming URI matches otherwise reject. I want to route to both of the above endpoints if the incoming URI matches with "/Location" or /Main.How should I write OR condition here ? Here is my xslt which I tried: Error: The below stylesheet is giving invalid URI error. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dp="http://www.datapower.com/extensions" xmlns:regexp="http://exslt.org/regular-expressions" extension-element-prefixes="dp regexp" exclude-result-prefixes="dp regexp"> <xsl:template match="/"> <xsl:variable name="uri_in" select="dp:variable('var://service/URI')"/> <xsl:variable name="serviceMapFileName" select="concat('local:///GATEWAY/Config/','service_map.xml')"/> <xsl:variable name="serviceMapTable" select="document($serviceMapFileName)" /> <dp:set-local-variable name="'var://local/valid_uri'" value="'N'" /> <xsl:for-each select="$serviceMapTable/servicelist/service"> <xsl:choose> <!-- Test if we have a match in the incoming URI and the service data map table. --> <xsl:when test="contains($uri_in, @Location)"> <xsl:message dp:priority="debug"> <xsl:value-of select="concat('name:', @name, ' id:', @Location, ' uri:', $uri_in)"/> </xsl:message> <dp:set-variable name="'var://service/routing-url'" value="concat('http://10.14.147.112:', @port,$uri_in)" /> <dp:set-variable name="'var://context/LoggingContext/service_name'" value="@name"/> <dp:set-local-variable name="'var://local/valid_uri'" value="'Y'" /> </xsl:when> <xsl:otherwise/> </xsl:choose> </xsl:for-each> <xsl:if test="not(string(dp:local-variable('var://local/valid_uri')) = 'Y')"> <dp:reject>Not a valid incoming uri to XI50 !!!</dp:reject> </xsl:if> </xsl:template> </xsl:stylesheet My service_map.xml file in the backend : <servicelist> <service name="MPG_Retailer" id="/Location" port="4188"/> <service name="MPG_Partner" id="/Main" port="9988"/> </servicelist> Re: How to convert JSON to XML using xslt? Hi Richie, I have used accept header as well but still it didn't work for me and also not only .xslt need to be used. We have requirement to convert JSON to XML using either XSLT or Gateway script or JQuery. How to convert JSON to XML using xslt? Hi All, How can I convert the below JSON input request to XML format using XSLT I have tried with this XSLT from here https://www.quora.com/Is-there-a-way-to-convert-JSON-to-JSONX-without-using-IBM-DataPower but I didn't get desired output and it's throwing an error:"illegal character { at offset 0" in Datapower. My input request: { "SMS": [{ "to": "+966874939494", "Message": "<subject+message> " }, { "to": "+96687499490", "Message": "<subject+message>" } ] } My Expected Output: <?xml version="1.0" encoding="UTF-8"?> <sendReq> <MsgRqHdr> <RqUID>SR_123</RqUID> <SCId>SF12</SCId> <FuncId>36</FuncId> <UsrId>S12</UsrId> <Dt>2020-05-26T15:12:13</Dt> <Service>SMS</Service> </MsgRqHdr> <Body> <Com> <Specific> <Type>SMS</Type> </Specific> <CValue> <Char> <Name>ID</Name> </Char> <Value>966560329031</Value> </CValue> <CValue> <Char> <Name>Event</Name> </Char> <Value>subject&messagetext</Value> </CValue> <CValue> <Char> <Name>EventParam</Name> </Char> <Value>English</Value> </CValue> </Com> </Body> Can someone help on this please ? I never even tried Gateway script to give a try. No response from WSDL. Hi, No response in SOAPui when i try to hit wsp service with the front side handler. Can anyone please help on this how to fix. Here is the probe transactions: I have checked the wsdl: binding="tns:EEMBL_spcCreate_spcPartner_spcProfile_spcProcess" name="EEMBL_spcCreate_spcPartner_spcProfile_spcProcess" ><soap:address location="http://10.14.170.191:8080/eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute&WSSOAP=1" ></soap:address ></port Where should I make changes to get the response from wsdl? I'm hitting from the datapower URL with my FSH :http://10.14.147.112:4882/eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute&WSSOAP=1 SolvedJunk characters in SOAPui response. Hi, I'm getting below soap response: ��Qk�0����]��lQ�&�u-8���L/V�Drc���R�����%��rs��:֕q��Qk�0����]��lQ�&�u-8���L/V�Drc���R�����%��rs��:֕q I have tried changing the settings--->Preferences--> unchecking Response Compression boxes. But still issue is not fixed. Can anyone help on this to fix this issue ? RAW Response: HTTP/1.1 200 OK Date: Thu, 24 Sep 2020 15:41:07 GMT Server: IBM_HTTP_Server _charset: UTF-8 cache-control: no-cache, must-revalidate, max-age=0 pragma: no-cache content-encoding: deflate transfer-encoding: Chunked content-type: text/xml;charset=UTF-8 Keep-Alive: timeout=10, max=100 Connection: Keep-Alive „’Qkƒ0…ÿŠä]£ÝlQË&„u-8·½•L/VÐDrcíþýR±µ³ƒ½%çœïrsˆ·:Ö•q Solved