1 Reply Latest reply on Jul 23, 2010 3:36 AM by 320397

    Broken error handling for SOAP Faults in OSB?

    320397
      Hi guys, just wondering if any of you have seen the following OSB issue (apologies for the long traces in this email)...

      I have a SOAP service that I am driving via a OSB Business Service. That service can raise SOAP faults, as this trace from the Business Service shows:

      ---
      <22/07/2010 11:58:23 AM EST> <Info> <OSB Kernel> <BEA-398203> < [OSB Tracing] Outbound response was received.

      Service Ref = JSS OSB Project/Business Services/JSSBusinessService URI = http://localhost:8088/mockJSSPublicBinding
      Error code = BEA-380001
      Error Message = Internal Server Error
      Message ID = 675204730882024607-6bac785d.129f796938b.-7eb6
      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">
      <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
      <http:Server>Jetty(6.1.x)</http:Server>
      <http:Transfer-Encoding>chunked</http:Transfer-Encoding>
      </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 =
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jss="http://www.yambay.com/jss">
      <soapenv:Body>
      <soapenv:Fault>
      <faultcode>-1111</faultcode>
      <faultstring xml:lang="en">Make sure that some BAD stuff happened</faultstring>
      <!--Optional:-->
      <faultactor>Alph</faultactor>
      <!--Optional:-->
      <detail>
      <jss:JobCreationException/>
      <!--You may enter ANY elements at this point-->
      <alph>This is additional info</alph>
      </detail>
      </soapenv:Fault>
      </soapenv:Body>
      </soapenv:Envelope>
      >
      ---

      However, when control flows back to the surrounding Proxy Service, as far as I can see, the fault info is lost and munged into something pretty much useless; neither $fault nor $body holds useful info:

      ---
      <22/07/2010 11:58:23 AM EST> <Info> <OSB Kernel> <BEA-398080> < [OSB Tracing] Entering stage CreateJob Stage with message context:
      [MessageContextImpl  body="<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
         [...snipped: ONLY my message...]
      </soapenv:Body>"
      operation="null"
      messageID="675204730882024607-6bac785d.129f796938b.-7eb8"
      a4sosb_serverID="q221802"
      yambayQueueId="6"
      attachments="<con:attachments xmlns:con="http://www.bea.com/wli/sb/context"/>"
      outbound="null"
      fault="<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
      <con:errorCode>BEA-380001</con:errorCode>
      <con:reason>Internal Server Error</con:reason>
      <con:details>
      <err:ErrorResponseDetail xmlns:err="http://www.bea.com/wli/sb/errors">
      <err:response-metadata xsi:type="http:HttpResponseMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
      <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
      <http:Server>Jetty(6.1.x)</http:Server>
      <http:Transfer-Encoding>chunked</http:Transfer-Encoding>
      </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>500</http:http-response-code>
      </err:response-metadata>
      </err:ErrorResponseDetail>
      </con:details>
      <con:location>
      <con:node>CreateJob PipelinePair</con:node>
      <con:pipeline>CreateJob PipelinePair_request</con:pipeline>
      <con:stage>CreateJob Stage</con:stage>
      <con:path>request-pipeline</con:path>
      </con:location>
      </con:fault>"
      inbound="<con:endpoint name="ProxyService$JSS OSB Project$Proxy Services$To JSS$CreateJobProxyService" xmlns:con="http://www.bea.com/wli/sb/context">
      <con:service/>
      <con:transport>
      <con:mode>request-response</con:mode>
      <con:qualityOfService>best-effort</con:qualityOfService>
      <con:request xsi:type="loc:LocalRequestMetaData" xmlns:loc="http://www.bea.com/wli/sb/transports/local" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <tran:headers xsi:type="loc:LocalRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports"/>
      <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
      </con:request>
      <con:response xsi:type="loc:LocalResponseMetaData" xmlns:loc="http://www.bea.com/wli/sb/transports/local" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <tran:headers xsi:type="loc:LocalResponseHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports"/>
      <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
      </con:response>
      </con:transport>
      <con:security>
      <con:transportClient>
      <con:username>&lt;anonymous></con:username>
      </con:transportClient>
      </con:security>
      </con:endpoint>"
      sheetSun="1000.00"
      header="<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>"
      ]>
      ---

      As far as I can see, this (section 35.6.2) talks about <alsb:ReceivedFault> and is wrong:

      http://download.oracle.com/docs/cd/E14571_01/doc.1111/e15867/modelingmessageflow.htm#insertedID6

      Blogs such as this:

      http://www.javamonamour.org/2010/04/soap-fault-in-osb.html

      are also incorrect/incomplete according to what I see.

      There is some discussion (not an exact match, but still) about a patch for this:

      http://forums.oracle.com/forums/thread.jspa?messageID=4260853&#4260853

      Am I missing something? There is a strong possibility that I am doing something stupid, of course...

      Cheers,

      Alph
        • 1. Re: Broken error handling for SOAP Faults in OSB?
          320397
          There is more to this story, actually.

          If I point OSB at this service (wrtten in Groovy, uses apache CXF under the covers), OSB handles the exception as expected:

          Float calculateShippingCost(String fromLoc,
          String toLoc,
          Integer nItem) {
          def cost = costs[fromLoc][toLoc] * nItem
          println "calculateShippingCost($fromLoc, $toLoc, $nItem) => $cost"
               throw new Exception("No way, Jose!")
          cost
          }

          If I use SoapUI to generate a mock service from this Service's wsdl and tell that service to generate a SOAP Fault response, OSB barfs as I described earlier (in fact I was using SoapUI to mock a service).

          Now you COULD say: this is a SoapUI problem, but a) I have used SoapUI in plenty of other (non OSB) situations without issue and b) I can see what looks like appropriate behaviour in the Business Service (see previous posting). It's just that getting the fault across the BS -> PS boundary that seems to be problematic.

          Thoughts/suggestions?

          Cheers,

          Alph