Hi Everyone,
I have a proxy A and I want to extract custom reponse collected from Backend B when response code is from Backend is 500.
Here is the result i have corresponding to "Error Content Body":
{
"fault": {
"faultstring": "Execution of ServiceCallout SC-XXXX failed. Reason: ResponseCode 500 is treated as error",
"detail": {
"errorcode": "steps.servicecallout.ExecutionFailed"}}}
When i use Extract Variable the calloutResponse variable is empty in trace.
I want access to "Service Callout Response Body" : <xml> custom reponse error from backend</xml> where http error code from backend is 500.
Best Regards
Solved! Go to Solution.
You can use the success.codes
Property to specify that response code 500 should not be treated as an error.
<ServiceCallout name='SC-1'>
<Request variable='outboundRequest'> ... </Request>
<Response>calloutResponse</Response>
<HTTPTargetConnection>
<SSLInfo> ... </SSLInfo>
<Properties>
<!-- look here -->
<Property name='success.codes'>2xx, 4xx, 5xx</Property>
</Properties>
<URL>https://api.example.com/</URL>
</HTTPTargetConnection>
</ServiceCallout>
Check the documentation for more information.
You can use the success.codes
Property to specify that response code 500 should not be treated as an error.
<ServiceCallout name='SC-1'>
<Request variable='outboundRequest'> ... </Request>
<Response>calloutResponse</Response>
<HTTPTargetConnection>
<SSLInfo> ... </SSLInfo>
<Properties>
<!-- look here -->
<Property name='success.codes'>2xx, 4xx, 5xx</Property>
</Properties>
<URL>https://api.example.com/</URL>
</HTTPTargetConnection>
</ServiceCallout>
Check the documentation for more information.
Thank you for the quick answer.
Best Regards.
I have similar situation reponse code from backend is coming 400 but service callout error code being set 500.
I have to return backend error code 400 but not able to retrive it. Please help.
Here is the result i have corresponding to "Error Content Body":
{
"fault": {
"faultstring": "Execution of ServiceCallout SC-XXXX failed. Reason: ResponseCode 400 is treated as error",
"detail": {
"errorcode": "steps.servicecallout.ExecutionFailed"}}}
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |