cancel
Showing results for 
Search instead for 
Did you mean: 

Fault Message from Sender System to Receiver System

Former Member
0 Kudos

Hi

I have a synchronous scenario

<b>SAP R/3 --> RFC Adapter -> XI -> SOAP Adapter --> Web Service</b>.

When web service returns successful response, it gets mapped properly to an internal table of RFC. But, when web service returns fault message (as parameters passed to the web service are incorrect), RFC gives dump. Below message is shown in sxmb_moni.

<i><?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Call Adapter

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Category>XIAdapterFramework</SAP:Category>

<SAP:Code area="MESSAGE">GENERAL</SAP:Code>

<SAP:P1 />

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: java.io.IOException: invalid content type for SOAP: TEXT/HTML</SAP:AdditionalText>

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack />

<SAP:Retry>M</SAP:Retry>

</SAP:Error></i>

<b>{</b> Sometime AdditionalText has different message, depends upon what parameters Sender system is providing <b>}</b>

Now I would like to provide this message back to SAP RFC. Even if I will create the Fault message type, how exactly I can map this " Exception message " with my fault message type.

I have checked weblog <a href="/people/shabarish.vijayakumar/blog/2006/11/02/fault-message-types--a-demo-part-1 Message Types - A Demo</a> but this one talks more about proxy & Asynch scenario.

Can you pls. provide steps with which I can map exceptions message of WS to RFC.

Best Regards

- Lalit Chaudhary -

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Please see the below links...

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ee5bc490-0201-0010-e9b5-a258cf08...

/people/sap.user72/blog/2006/01/16/xi-propagation-of-meaningful-error-information-to-soap-client

Regards

Chilla...

bhavesh_kantilal
Active Contributor
0 Kudos

Lalit,

><i><SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: java.io.IOException: invalid content type for SOAP: TEXT/HTML</SAP:AdditionalText></i>

This is a standard error.Your webservice expects a APPLICATION / XML as the content type. This can be handled by the Message Transform Bean .

Look into this Thread and Stefan's answerr on how to handle this,

Regarding your other question~ Sending Fault Message Back to RFC,

1. In your RFC , is a fault mesage defined?

2. In the Wbeservice, is the Fault Message Defined?

If yes for 1 and 2, then in your Inbound Message Interafce of the Webservice, select the fault message. Like wise do the same for the RFC also.

Now, in the interface mapping you will find a new tab called "Fault" and you can map the Fault message of the webservice to the RFC fault message and this will trigger the messge back to the RFC.

Regards

Bhavesh

Former Member
0 Kudos

Thanks Bhavesh.

Error message is just an example. Also the above message I got when the WebService is down. Earlier also this message I got due to various reasons.

If I will be having the 1 ( Exception message from RFC ) & 2 ( Fault Message ) then it will be like simple Req To Req & Res To Res mapping.

Also I have never seen this "Fault" tab in interface mapping. Is it mandatory to create " Fault Message Type " for this & map it with RFC exceptional message.

What I wish if we can utilize the " Error " xml file from SOAP header of sxmb_moni. Like the parameter " <SAP:AdditionalText > ".

- Lalit -

Former Member
0 Kudos

lalit,

Also I have never seen this "Fault" tab in interface mapping.

this option comes if you came your scenario synchorouse and define fault message type in our message interface

Regards

Sreeram.G.Reddy

bhavesh_kantilal
Active Contributor
0 Kudos

Lalit,

Only after you add the fault message to both the RFC and the Inboudn Synch message interface will you will the tab FAULT in the interface mapping.

Just as you have a Request and Response Mapping tab in the Interface mapping, once the Fault Messages are added, the Fault Message Tab will also be found .

You will have one Fault Message Mapping where you will map the Fault message of the Webservice to the Fault Mesage of the RFC.

Regards

Bhavesh

Former Member
0 Kudos

Ok I do have Fault Message Type right now but don't have RFC Exception message & Fault Message Mapping between these .

I am creating rest of the two & will update the thread.

Thanks

- lalit -

bhavesh_kantilal
Active Contributor
0 Kudos

Let us know if it worked.

Regards

Bhavesh

Former Member
0 Kudos

Hi

In Inbound message interface selecting 2 fault message types

1st is the exception structure which is coming from Web-Service side ( importing this as the XSD )

2nd is the <RFC>.Response ( as SAP team is not providing exception structure )

After this design the mapping between the above 2 structures.

But even after doing this & refreshing Interface Mapping. I am not able to view the FAULT message <b>Tab</b> with the Request & Response Tab.

What am I missing now, can you pls. suggest.

- Lalit -

Former Member
0 Kudos

Hi,

Plz check that RFC contains the exception/ supports exceptons??

Check it with se37 and see there..

then only it will come i hope..

Regards

Chilla..

bhavesh_kantilal
Active Contributor
0 Kudos

Lalit,

1. Inyour Inbound Message interface you should select only the Webservice Fault Message.

2.As far as I know, your SAP team has to provide the fault message in the RFC as only then you will be able to map the Webservice fault message to the RFC fault message and propogate it back to the SAP system .

Only if both your outbound and inbound interface have the fault messages applied in them, will you be able to see the fault message tab in the interface mappig . Currently as I guess your RFC does not have the fault message you are not able to see the same.

Regards

Bhavesh

Former Member
0 Kudos

Thanks for quick reply Chandra.

Ok I asked Dev team to provide me with the RFC exception structure. But tell me this doesn't sounds logical because when I am selecting the fault types as XSD & response structure & doing the mapping on them then why I am not getting Fault tab.

Does SAP has something internally which is checking for <i><RFC>.exception</i> in case our outbound message type is SAP Structure ?

- Lalit -

Former Member
0 Kudos

Lalit,

you use the same response strucutre or other strucutre to map our fault message.

Former Member
0 Kudos

I got the <RFC>.exception structure from SAP Team.

And from my side I build the "xsd" file for following generic Error structure -->

<i><?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Call Adapter

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Category>XIAdapter</SAP:Category>

<SAP:Code area="PARSING">SOAP_EXCEPTION</SAP:Code>

<SAP:P1 />

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText><u>An error message</u></SAP:AdditionalText>

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack />

<SAP:Retry>M</SAP:Retry>

</SAP:Error></i>

I import this xsd file ( as External Definitions ) and keep this in the Inbound Interface as Fault Message Type & mapped the contents of it with <i><RFC>.exception</i> structure.

Now when their is some Application error like Web-Service is down, we are not getting <b>DUMP</b> in SAP R/3 system but I mapped the "AdditionalText" field of xsd file with " <i>Attributes --> V1</i> " of <i><RFC>.exception</i> structure and on SAP R/3 system the field <i>message-V1</i> is empty which suggest nothing is coming in this field.

Then I even tried to map constant values <i><RFC>.exception</i> structure but in SAP R/3 nothing is coming. Can you suggest how actually SAP developers can capture these values or is their anything I am missing on XI side.

Best Regards

- Lalit Chaudhary -

Former Member
0 Kudos

Hi All

Does anyone tried this before i.e mapping of Error payload with RFC.Exception structure.

Pls. provide your inputs for this.

Thanks

- Lalit -