cancel
Showing results for 
Search instead for 
Did you mean: 

SOAPFault Body details for SOAP lookup failed calls(in a UDF)

Former Member
0 Kudos

Hi all,

Our scenario is on SOAP lookup channels that when any

call fails we are getting a 500 HTTP exception in the TRACES (NWA). We need to know how we can get that SOAPFault Body

for that kind of calls.

To summarize the scenario.

1. JDBC sender is polling the data from a database and sends it to Integration Engine.

2. The message arrives to mapping.

3. Mapping use channel(defined in Integration Directory) lookups to consume external webservices.

3.1 The webservice Server returns an HTTP 500 error(this is an internal server error which can be caused by many reasons, the details of the error are sent in SOAPFault Body).

3.2 We go to traces and log to check the error and t here is no details about the exact error in the server(It shows only the generic http 500 error). It is not showing the SOAPFault Body content(which contains the exact error details).

Any help will be really appreciated.

Thanks

Ivan

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

closed

udo_martens
Active Contributor
0 Kudos

Hi Ivan,

you can use the "do Not Use SOAP Envelope" option in the soap channel and "XMBWS.NoSOAPIgnoreStatusCode = true" in module tab -> Module configuration. The module Key will be "soap". Like Neetesh Raj recommended in thread

Regards,

Udo

baskar_gopalakrishnan2
Active Contributor
0 Kudos

This is the downside of using SOAP Calls in the UDF. Hard to maintain. You might want to write logic to retrieve error information (like prinstacktrace if the exception occurs in the catch block. The response logic should cover errror details if the exception occurs. Also discuss with the webservice team to provide valid exceptions or errors.

Former Member
0 Kudos

Gopal,

We are using the following code:


accessor = LookupService.getSystemAccessor(soapCreateSession);
reqStream = (InputStream) new ByteArrayInputStream(reqString.getBytes());
XmlPayload reqPayload = LookupService.getXmlPayload(reqStream);
XmlPayload resPayload = (XmlPayload)accessor.call(reqPayload);
...
catch (Exception le)
 {
le.printStackTrace();
.....

Do you know how to get the SOAPFault Body? like in this code We we use HttpURLConnection(httpConn):


InputStreamReader errorDetails = new InputStreamReader(httpConn.getErrorStream());

@Martens, what you are mentioning works for Sync. Scenarios when we have an end to end scenarios, but in this case we have a SOAP look up scenario in a UDF. thanks for your inputs.

Regards,

Ivan

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Use PrintStackTrace() to get error logs. That is much simpler. HTTP BODY contains SOAP ENVELOPE which in turn contains SOAP HEADER + SOAP BODY. So I dont know how this api is implemented to give soap fault errors. Basically you need to get SOAP Header to get the error details during the unhappy flow.

Former Member
0 Kudos

Gopal,

Thanks for your quick reply.

We used PrintStackTrace() but it is only showing the HTTP error code but not the details error returned by webservice server.



com.sap.aii.af.service.api.AFException: XI AF API call failed. Module exception: 'SOAP Error'. Cause Exception: 'SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 500 Internal Server Error.'.

however when se use SOAPUI tool, additionally to the HTTP error we are able to see the SOAPFAULT


<soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>Server was unable to process request. ---> Session is invalid or expired</faultstring>
         <detail/>
      </soap:Fault>
   </soap:Body>

That we are trying to reach i out logs, and using PrintStackTrace We did not get. I wonder If there is any parameter to add in the channek to get those details in the log.

Thanks and regards,

Ivan

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Check whether [link|http://pdpsappireference.blogspot.com/2011/03/look-up-in-mapping-parsing-xml.html]is helpful. To retrieve fault message you might have to develop some adapter module. One other option is shift your mapping logic to receiver side and based on the response you forward the message to the original target system. You can even implement without bpm for async sync scenario.