HI Kumar,
if the response code returned as 500, it will not stop the process.
However you can log the report and stop the process by following the code:
<dp:variable name="responsecode" />
<dp:url-open target="http://example.com/api" response="responsecode">
<!-- Request setup if needed -->
</dp:url-open>
<!-- Check the response code -->
<xsl:if test="$responsecode = 500">
<!-- Log the error -->
<dp:log level="error" category="apigw" xmlns:dp="http://www.datapower.com/extensions">
</dp:log>
<!-- Raise a fault to stop processing -->
<dp:raise-fault
name="HTTP500Error"
xmlns:dp="http://www.datapower.com/extensions"
description="Remote server returned HTTP 500 - Internal Server Error"/>
</xsl:if>
<!-- Continue with processing only if not error -->
If you want to play with the response code then you can use xsl:choose like below
<dp:variable name="responsecode" />
<dp:url-open target="http://example.com/api" response="responsecode">
<!-- Request setup if needed -->
</dp:url-open>
<!-- Check if response is 500 -->
<xsl:choose>
<xsl:when test="$responsecode = 500">
<!-- Log error -->
<!-- Raise fault and exit -->
<dp:raise-fault
name="HTTP500Error"
xmlns:dp="http://www.datapower.com/extensions"
description="Remote server returned HTTP 500 - Internal Server Error"/>
</xsl:when>
<xsl:otherwise>
<!-- Response is NOT 500: continue processing -->
<!-- Continue with your processing -->
<!-- e.g., transform, route, or respond -->
</xsl:otherwise>
</xsl:choose>
------------------------------
Nrusingha Sahoo
------------------------------
Original Message:
Sent: Tue May 27, 2025 02:49 AM
From: Kumar .
Subject: how response code will work in dp:url-open
Dears,
I am using dp:url-open in my XSLT to call MQ and ACE. However, one thing is not clear to me regarding setting a response.
response="xml | binaryNode | ignore | responsecode | responsecode-binary | responsecode-ignore"
If set response ="responsecode" as below, and if I receive 500 or any other from the target URL, will the flow be stopped or continue?
<dp:url-open target="URL" response="responsecode"
</dp:url-open>
------------------------------
Kumar
------------------------------