cancel
Showing results for 
Search instead for 
Did you mean: 

Fault message structure at PI

Former Member
0 Kudos

Hi,

In one of our scenario my Webservice client said that they will return a SOAP fault message in case of any application error.

The structure will look like as below.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
  <faultcode>SOAP-ENV:Server</faultcode>
<faultstring xml:lang="en">error message</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

How do I define my SOAP fault message structure at PI.

I use some XML/xsd converter to convert client fault xml to xds, but it is not giving me correct xsd. faultcode and faultstring getting created as two separate MT.

Regards,

Navneet

Accepted Solutions (0)

Answers (2)

Answers (2)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>How do I define my SOAP fault message structure at PI.

You are consuming the third party web service. You basically use their wsdl to create target structure. If that is right, you will see fault message structure in addition to request and response in the WSDL itself. You need to use that in the target structure. Sender side(outbound message) you can customize any structure you like and map the fault message response(third party or reciever or inbound) to the sender side (outbound message). This way you return the fault message of third party to the sender system.

Example: If you do proxy to webservice(third party), the fault message third party is mapped to the sender structure proxy and pass it to sap system.

Former Member
0 Kudos

Hi Bhaskar, Thanks for the reply

My scenario is Proxy to SOAP synchronous.

We have define the structure at proxy side to receive fault message response from Webservice.

The webservice provided by 3rd party does not contain any fault message structure in it. It just contain request and response and they are saying that the fault message will be returned by application and will look like my above post.

Now as per Jin shin blog we can add required fault message structure as external definition and can be used at Interface level to receive fault message from Webservice.

But problem is that when  I converted fault xml to xsd and used in interface, I able to get the response message but my response is failing with below error

“com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Error message”

It clearly said that the response we are getting is not as per structure we have define as external definition.

Now I want to know how I can define my structure at PI end, which matches as per Webservice response.

Webservice response:

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

<SOAP-ENV:Header/>

   <SOAP-ENV:Body>

<SOAP-ENV:Fault>

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

<faultstring xml:lang="en">Required parameters have not been passed with this service.</faultstring>

</SOAP-ENV:Fault>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Thanks

Navneet

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>It clearly said that the response we are getting is not as per structure we have define as external definition.Now I want to know how I can define my structure at PI end, which matches as per Webservice response.

This is the clear definition. The web service provider should give the fault message. You have to use their XSD as fault message in the target structure. You cannot define as you like at your side. please talk to the provider to get their fault message structure. Normally it should be available in the WSDL. 

The error message shows that your fault message structure does not match with the webservice fault message.

Note:Fault message is used for handling application related error messages.

Former Member
0 Kudos

Hi ,

We have received the XSD structure for fault message.

We imported the fault XSD in my interface  as per jin blog

http://scn.sap.com/people/jin.shin/blog/2007/05/21/handling-web-service-soap-fault-responses-in-sap-...

But we are still facing same error

"com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Error message"

Could you please let me know  where I am wrong.

Regards,

Navneet

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Quick tip is use the same wsdl and test using soapui directly and see how you get the response for the fault message (application error). You can compare that response with the fault message structure you imported and using it in the interface. Then you will get idea about any syntax issue or namespace issue or so.

Former Member
0 Kudos

Hi Navneet,

Can you please check this link:

https://scn.sap.com/thread/1675917

Regards,

Beena

Former Member
0 Kudos

Hi Beena,

Thanks for your response.

We have done below changes  (SAP Note-1055678)

Used below adapter module parameter

1.     Module Key= soap

        Parameter Name=    noSOAPMakeSysErrFromResponseFault  

        Parameter value=  false

2.    Module Key= soap

       Parameter Name=XMBWS.NoSOAPIgnoreStatusCode

       Parameter value=  true

Now my fault message are entring SAP PI system, but system treating  it as response payload.We have written a java mapping to convert both successful and error response to an expected xml.

My scenario is working fine when we are triggering the message from PI RWB. if we are triggering same message from PROXY, my webservice is not returning extected response. it is returning some thing else  and if I check the error log it giving me below error.

"MESSAGERequest processing failed; nested exception is org.springframework.ws.soap.SoapMessageCreationException: Could not create message from InputStream: Invalid Content-Type:application/xml. Is this an error message instead of a SOAP response?; nested exception is com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:application/xml. Is this an error message instead of a SOAP response?"

We are on PI 7.3.

any idea why it is working from PI RWB and not working when we are triggering for PROXY.

Regards,

Navneet

JaySchwendemann
Active Contributor
0 Kudos

Having a similar requirement currently. Did you resolve yours? 3rd party Webservice sending standard soap fault message but it's not defined in their wsdl. However, I don't think that's the reason its failing. I''m more suspecting something in the like of http status code 500 directly failing with system error? Not sure though

Cheers

Former Member
0 Kudos

This is an old message but recently we had a similar problem, we too had  Invalid Content-Type:application/xml  when handling the fault message and the interface worked in soapui but not from proxy.


We added in the receiver

AF_Modules/MessageTransformBean

Transform.ContentType  text/xml


And with that the interface worked.



Former Member
0 Kudos

Hi Navneet,

Please check sap note 856597.

  • Q: What should my web service return to the adapter?

The fault message will return system error as per note. If you wish to map it, you will have to use do not use soap envelope option in this case.

Regards,

Beena