Advertisements
RSS

Receive empty SOAP response in Oracle Service Bus (invalid SOAP fault)

10 Aug

We had some problems using Oracle Service Bus to perform a callout to an external webservice. All callouts resulted in a general BEA-38001 Error. In the end we discovered that the issue was functional (wrong data in the request), however the technical documentation of the external webservice informed us that we should receive a SOAP Fault. However this apparantly was not the case, as could be seen in the debug console. The SOAP Body element was empty:


After enabling message tracing on the specific business service we noticed the following logging:


<BEA-398203> <
 [OSB Tracing] Outbound response was received.

Service Ref = someProject/BusinessServices/someBusinessService
 URI = https://externalhost:443/SomePort
 Error code = BEA-380001
 Error Message = Internal Server Error
 Message ID = 8592423476474314819--7dc5b3e6.138425ff239.-29c0
 Response metadata =
 <xml-fragment>
 <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <tran:user-header name="SOAPAction" value="&quot;&quot;"/>
 <http:Connection>close</http:Connection>
 <http:Content-Length>787</http:Content-Length>
 <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
 <http:Date>Thu, 28 Jun 2012 11:25:22 GMT</http:Date>
 </tran:headers>
 <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">2</tran:response-code>
 <tran:response-message xmlns:tran="http://www.bea.com/wli/sb/transports">Internal Server Error</tran:response-message>
 <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
 <http:http-response-code xmlns:http="http://www.bea.com/wli/sb/transports/http">500</http:http-response-code>
 </xml-fragment>
 Payload =
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body><env:Fault><faultcode xmlns="">env:003</faultcode><faultstring xmlns="">Standard Error: Authentication failed</faultstring><faultactor xmlns="">m86b1b2f-4d34-46cd-d538-c21ddb88743</faultactor></env:Fault></env:Body></env:Envelope>
>

Which is strange, because the payload clearly showed us that their is a soap envelope containing a soap fault. Normal OSB behaviour would mean this payload is then used in the <body> element of the SOAP response. However for some reason in this case the result was an empty <body> element, so looking more closely to the payload we could see that the content is:


<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <env:Body>
 <env:Fault>
 <faultcode xmlns="">env:003</faultcode>
 <faultstring xmlns="">Some Functional Error</faultstring>
 <faultactor xmlns=""someURI</faultactor>
 </env:Fault>
 </env:Body>
</env:Envelope>

The problem here seems to be the faultcode element, since it holds the value 003. However the W3C SOAP standard only allows the values: Client, Server, MustUnderstand and VersionMismatch. And it seems the  Oracle Service Bus is very strict about this.

After some additional testing with SOAPui as service consumer we can see that the message also fails there. Remember that SOAPui by default does not perform these validations and you will need Assertions for that.

This test (using a mockservice) shows that when the same response comes back with a valid faultcode the SOAPui assertions succeed. In the example we use the “.” seperator which is allowed and use Client as prefix since this is a valid faultcode.

The OSB is strict regarding the W3C standards and therefor elements like <body> are protected. (This is also why you shouldn’t use the Assign action on the $body variable, but better use the Replace node content functionality). So the real reason of the problem seems that the external service sends an invalid SOAP envelope.

Conclusion:

In the past I had an identical problem with an endpoint that returned a HTML page (with some functional text information) instead of an expected SOAP message. Lessons learned: if you really want to know what you response looks like, enable tracing on the Business Service and examine the payload.

Advertisements
 
5 Comments

Posted by on 10-08-2012 in Oracle, OSB, SOAP, SOAPui

 

Tags: , ,

5 responses to “Receive empty SOAP response in Oracle Service Bus (invalid SOAP fault)

  1. ravisankar1

    01-09-2012 at 04:15

    Hi jvzoggel,

    In which version of OSB you faced this issue. I am trying to replicate the same issue in OSB 11.1.1.5, but no luck, it’s working with out issues.

    Thanks,
    Ravi

     
    • jvzoggel

      05-09-2012 at 11:47

      Hello Ravi,

      The client site was using 11.1.1.5 as well. It’s currently hard to replicate the issue on location, but your reply makes me doubt/wonder if I could replicate it myself again. Will try to make some time for this.

      Thanks for the feedback!!

      kind regards,

      Jan

       
  2. Paco arnau

    10-12-2013 at 16:50

    Hi jvzoggel: I had the same problem. Do you know if is it possible to treat the payload on the orchestration process. Do you know how to access the payload from the bus?
    kind regards.

     
  3. Peter Birk Nielsen

    04-04-2014 at 16:43

    Hi.

    Thanks for your analysis.

    I observed a similar problem: The body value would be empty when the flow returned from the business service. However, in my case there were no errors in the soap fault.

    In my case the problem disappeared when I disabled payload logging for the business service. There seems to be a bug somewhere in the OSB that causes errors to disappear when payload logging is enabled.

     
  4. Shan

    20-08-2014 at 06:10

    I am experiencing similar problem. Since I don’t have control over the external service how can I catch this non-compliance fault message?

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: