Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

How to route my input request using xslt and get Soap Response ?

0 Kudos


I have searched many blogs for sample XSLT. Hope I get help from here. I'm trying to route to the destination, if it's successful it should display success response in soap format otherwise failure response but my xslt is not working as expected.

Here is my input request:

<soapenv:Envelope xmlns:soapenv="" xmlns:ord="http://host:port/" xmlns:ees="">  <soapenv:Header/>  <soapenv:Body>  <ord:Input>  <ees:List>  <ees:Entry>  <ees:Id>123</ees:Id>  <ees:Number>G1</ees:Number>  </ees:Entry>  </ees:List>  </ord:Input>  </soapenv:Body></soapenv:Envelope>

Here is my XSLT:

<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0"   xmlns:xsl=""    xmlns:dp=""   extension-element-prefixes="dp"    exclude-result-prefixes="xsl dp">   <xsl:template match="/">     <xsl:variable name="uriIn" select="dp:variable('var://service/URL-in')"/>     <xsl:choose>       <xsl:when test="contains($uriIn,'/IDEV/')">         <dp:set-variable name="'var://service/routing-url'" value="concat('http://http://host:port/',substring-after($uriIn,'/IDEV/'))"/>       <soapenv:Envelope xmlns:soapenv="" xmlns:ord="http://host:port/">  <soapenv:Header/>  <soapenv:Body>  <ord:Output>     <ord:faultactor>Success</ord:faultactor>     <ord:Resp>     <ord:IntegrationStatus>Success1</ord:IntegrationStatus>     <ord:ErrorDescription>Description</ord:ErrorDescription>       </ord:Resp>     <ord:faultcode>200</ord:faultcode>     <ord:faultstring>Success2</ord:faultstring>  </ord:Output>  </soapenv:Body></soapenv:Envelope></xsl:when>       <xsl:otherwise>         <dp:set-variable name="'var://context/envRouter/reject'" value="'Connection Failed to the Backend'"/>        <dp:reject override="true | false ">        <soapenv:Envelope xmlns:soapenv="" xmlns:ord="http://host:port">  <soapenv:Header/>  <soapenv:Body>  <ord:Output>     <ord:faultactor>Connection Failed</ord:faultactor>     <ord:Resp>     <ord:IntegrationStatus>Failed</ord:IntegrationStatus>     <ord:ErrorDescription>Connection error</ord:ErrorDescription>       </ord:Resp>     <ord:faultcode>500</ord:faultcode>     <ord:faultstring>Failed</ord:faultstring>  </ord:Output>  </soapenv:Body></soapenv:Envelope>        </dp:reject>                </xsl:otherwise>            </xsl:choose>   </xsl:template></xsl:stylesheet>

In my output I'm getting the same input as response. But not the success SOAP message as response. Where have I gone wrong in my XSLT ? can someone please help on this.

Expected Output If success:

<soapenv:Envelope xmlns:soapenv="" xmlns:ord="http://host:port"><br>  <soapenv:Header/><br>  <soapenv:Body><br>  <ord:Output>   <br>  <ord:faultactor>Success</ord:faultactor>   <br>  <ord:Resp>   <br>  <ord:IntegrationStatus>Success1</ord:IntegrationStatus>   <br>  <ord:ErrorDescription>Description</ord:ErrorDescription><br>  </ord:Resp>   <br>  <ord:faultcode>200</ord:faultcode>   <br>  <ord:faultstring>Success2</ord:faultstring><br>  </ord:Output><br>  </soapenv:Body><br>  </soapenv:Envelope>

Product and Topic Expert
Product and Topic Expert
0 Kudos

Thank you for visiting SAP Community to get answers to your questions. Since you're new in asking questions here, I recommend that you familiarize yourself with (if you haven't already), as it provides tips for preparing questions that draw responses from our members.

Should you wish, you can revise your question now by selecting Actions, then Edit.

Finally, if you're hoping to connect with readers, please consider adding a picture to your profile. Here's how you do it: . By personalizing your profile with a photo of you, you encourage readers to respond.

Best regards


SAP Community moderator