cancel
Showing results for 
Search instead for 
Did you mean: 

REST Webservice Exception Handling

Former Member
0 Kudos

Hi Experts,

I am working on a synchronous scenario Proxy to Rest web service and I have been given a requirement to capture the exceptions

that will get thrown from the webservice . They have not shared a fault message type WSDL structure .

Is there any possible way to capture the exceptions thrown by the REST webservice and pass it back to the service consumer Proxy. A sample exception thrown by the webservice as below.

<ns3:error>

<errorSummary>error summary here</errorSummary>

<errorText>Not Found</errorText>

</ns3:error>

Accepted Solutions (1)

Accepted Solutions (1)

engswee
Active Contributor
0 Kudos

Hi Nick

WSDL is only applicable to SOAP-based web service so you won't have any for REST services.

I haven't personally used SAP's REST adapter but I have used Advantco's. In my experience using that to consume REST services, I just define fault message types in ESR for both sender and receiver service interfaces, and link them via a fault mapping. I've mentioned it in the "Fault handling" section of my blog below. Maybe you can try that approach with SAP's REST adapter.

Another alternative you can try out is to implement some custom error handling as detailed in the blog below.

Rgds

Eng Swee

Former Member
0 Kudos

Thanks Eng Swee Yeoh ...I will look at both the options and check if any of them can help...

Appreciate your valuable response. Will let you know if it solved my problem.

engswee
Active Contributor
0 Kudos

How did this go? Did you manage to route back the sync exception to the proxy?

Former Member
0 Kudos

Hi Eng,

We put that exception handling on hold due to a change in requirement that came from business .

I will most likely try out custom  error handling as we use the SAP REST Adapter .

I will keep you updated on how it goes .

Regards,

Nick

Answers (0)