cancel
Showing results for 
Search instead for 
Did you mean: 

Exception handling in synchronous proxy - web service scenario

Former Member
0 Kudos

Hi Gurus,

I have a synchronous scenario in which SAP is sending a request via XI using SOAP and receiving a response back. As part of this scenario, I am consuming standard web service APIs provided by the third party.

Since, every request has to contain the connecting user id and password provided by the third party, I am sending/receiving messages without SOAP envelop (achieved by clicking 'Do not use SOAP envelope' checkbox in SOAP Receiver Communication Channel).

For this scenario, we are including the user id and password in the request message using XSLT mapping and the request number using simple message mapping.

The fault message of the web service is being mapped to the fault message created in XI under Fault Message Types.

The interface mapping page has got 3 tabs, one each for Request message mapping, Response message mapping and Fault message mapping.

When I trying to test a failure scenario by giving an incorrect request number(since this is the only input parameter in gthe request message apart from user id and password), it is throwing up "MAPPING">EXCEPTION_DURING_EXECUTE error.

Actually, for such requests, I am getting a proper fault response back from the third party which I can see in XI (in moni) as response to my request but when I am looking at the message in moni in SAP, I am only seeing "MAPPING">EXCEPTION_DURING_EXECUTE. Even I can see the exception in the trace section of my response in moni in XI.

My feeling is that the fault message mapping is not getting executed at all.

I also thought to do a 2:1 multimapping in which, the target side will contain the response message type created in XI but the source will contain two messages, i.e. Normal response message structure provided by third party and Fault message structure provided by third party but I am not sure whether this is possible without using BPM.

Please suggest the best way to resolve this issue.

Accepted Solutions (0)

Answers (2)

Answers (2)

Shabarish_Nair
Active Contributor
0 Kudos

go to the trace in SXMB_MONI and check which mapping is being executed.

Also are you able to successfully independently test the fault mapping with the fault response from WS

Former Member
0 Kudos

Gurus,

I had actually referred to the link given by you to do the mapping. The problem is that the fault mapping is not getting invoked. The mapping is throwing up a mapping exception because it is not getting a response as a result of the exception.

regards

Debansu

Former Member
0 Kudos

hI,

Check your soap response format for the fault message...whether it contains the detail tag....or not..

HTH

Rajesh

Former Member
0 Kudos

Hi,

This is perhaps happening because Service is NOT raising SOAP exception but returning message via normal SOAP response.

In this case response message you are receiving is not identical to the message is returning by service.

For example when service is receiving wrong request number then service is retuning message (NOT fault) saying this is wrong number and your mapping program doesn't have any suitable mapping for same.

I suggest to see the response payload and see if you have valid mapping for same.

Regards,

Gourav

Former Member
0 Kudos

The Fault message raised from 3rd party service, is structured as follow ??

HTTP/1.1 500 Internal Server Error

Content-Type: text/xml; charset="utf-8"

Content-Length: nnnn

<SOAP-ENV:Envelope

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

<SOAP-ENV:Body>

<SOAP-ENV:Fault>

<faultcode>SOAP-ENV:Server</faultcode>

<faultstring>Server Error</faultstring>

<detail>

<e:myfaultdetails xmlns:e="Some-URI">

<message>My application didn't work</message>

<errorcode>1001</errorcode>

</e:myfaultdetails>

</detail>

</SOAP-ENV:Fault>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Take a look here:

/people/jin.shin/blog/2007/05/21/handling-web-service-soap-fault-responses-in-sap-netweaver-xi

and to this standard document:

http://help.sap.com/saphelp_nwpi711/helpdata/en/48/5946db5f693912e10000000a42189b/content.htm