Monday, October 22, 2012

Service callout v.s. Route

In Oracle OSB service callout action and route action do the almost same thing: invoke a service synchronously.   But when the fault happens during the invocation how OSB populate the implicit object variables such as: $body, $fault.
Here is one service defined by the interface QueryService.wsdl.  The below lists some scenarios in service callout and rout:

Routing

Service provider returns a SOAP fault.
$body is populated with the fault returned by the provider.

<soapenv:Body xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Fault>
    <faultcode>SYS-0001</faultcode>
    <faultstring>An unknown error has occurred in one of Virgin Australia's systems.</faultstring>
    <detail>
      <isl:fault xmlns:isl="http://com.toic.telecom/ISL/ServiceInventoryManagement/queryServiceByService/V4" xmlns:cdm="http://com.toic.telecom/ISL/ServiceInventoryManagement/queryServiceByService/V4/CDM" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <cdm:faultCode>concurrentAccessException</cdm:faultCode>
        <cdm:faultString>String</cdm:faultString>
        <cdm:faultActor>String</cdm:faultActor>
        <cdm:detail>
          <cdm:GPELogReference>String</cdm:GPELogReference>
        </cdm:detail>
        <cdm:exception>
          <cdm:code>String</cdm:code>
          <cdm:reason>String</cdm:reason>
          <cdm:actor>String</cdm:actor>
        </cdm:exception>
      </isl:fault>
    </detail>
  </soapenv:Fault>
</soapenv:Body>

$fault is Weblogic error.
<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:location>
    <con:node>Route to RoutingFaultHandlingBusinessService</con:node>
    <con:path>response-pipeline</con:path>
  </con:location>
</con:fault>


Service provide response timeout
$body
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>

$fault
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
  <con:errorCode>BEA-380000</con:errorCode>
  <con:reason>[WliSbTransports:381304]Exception in HttpOutboundMessageContext.RetrieveHttpResponseWork.run: java.net.SocketTimeoutException
java.net.SocketTimeoutException
            at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse$SocketTimeoutNotification.&lt;clinit>(AsyncResponseHandler.java:555)
            at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse.handleTimeout(AsyncResponseHandler.java:400)
            at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse.timeout(AsyncResponseHandler.java:506)
            at weblogic.socket.SocketMuxer$TimerListenerImpl.timerExpired(SocketMuxer.java:1060)
            at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
            at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)</con:reason>
  <con:location>
    <con:node>Route to RoutingFaultHandlingBusinessService</con:node>
    <con:path>response-pipeline</con:path>
  </con:location>
</con:fault>

Cannot connect to service provide
$body
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <v4:queryServiceByService xmlns:v4="http://com.toic.telecom/ISL/ServiceInventoryManagement/queryServiceByService/V4" xmlns:cdm="http://com.toic.telecom/ISL/ServiceInventoryManagement/queryServiceByService/V4/CDM">
    <v4:service>
      <!--Optional:-->
      <cdm:serviceId>1234</cdm:serviceId>
      <!--Optional:-->
      <cdm:serviceStatus>string</cdm:serviceStatus>
      <!--Optional:-->
      <cdm:location>
        <!--Optional:-->
        <cdm:placeKey>
          <!--Optional:-->
          <cdm:primaryKey>string</cdm:primaryKey>
        </cdm:placeKey>
      </cdm:location>
      <!--Optional:-->
      <cdm:serviceType>string</cdm:serviceType>
      <!--Optional:-->
      <cdm:serviceNotes>
        <!--Zero or more repetitions:-->
        <cdm:serviceNote>
          <!--Optional:-->
          <cdm:note>string</cdm:note>
        </cdm:serviceNote>
      </cdm:serviceNotes>
    </v4:service>
    <v4:type>string</v4:type>
    <v4:customerAccount>
      <!--Optional:-->
      <cdm:accountId>string</cdm:accountId>
    </v4:customerAccount>
  </v4:queryServiceByService>
</soapenv:Body>

$fault
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
  <con:errorCode>BEA-380002</con:errorCode>
  <con:reason>Tried all: '4' addresses, but could not connect over HTTP to server: 'markchen-laptop', port: '8188'</con:reason>
  <con:location>
    <con:node>Route to RoutingFaultHandlingBusinessService</con:node>
    <con:path>request-pipeline</con:path>
  </con:location>
</con:fault>

Service callout

Service provider returns a SOAP fault.

$body

  <v4:queryServiceByService>
    <v4:service>
      <!--Optional:-->
      <cdm:serviceId>4321</cdm:serviceId>
      <!--Optional:-->
      <cdm:serviceStatus>?</cdm:serviceStatus>
      <!--Optional:-->
      <cdm:location>
        <!--Optional:-->
        <cdm:placeKey>
          <!--Optional:-->
          <cdm:primaryKey>?</cdm:primaryKey>
        </cdm:placeKey>
      </cdm:location>
      <!--Optional:-->
      <cdm:serviceType>?</cdm:serviceType>
      <!--Optional:-->
      <cdm:serviceNotes>
        <!--Zero or more repetitions:-->
        <cdm:serviceNote>
          <!--Optional:-->
          <cdm:note>?</cdm:note>
        </cdm:serviceNote>
      </cdm:serviceNotes>
    </v4:service>
    <v4:type>?</v4:type>
    <v4:customerAccount>
      <!--Optional:-->
      <cdm:accountId>?</cdm:accountId>
    </v4:customerAccount>
  </v4:queryServiceByService>
</soapenv:Body>

$fault

<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
  <con:errorCode>BEA-382500</con:errorCode>
  <con:reason>OSB Service Callout action received SOAP Fault response</con:reason>
  <con:details>
    <con1:ReceivedFaultDetail xmlns:con1="http://www.bea.com/wli/sb/stages/transform/config">
      <con1:faultcode>SYS-0001</con1:faultcode>
      <con1:faultstring>An unknown error has occurred in one of Virgin Australia's systems.</con1:faultstring>
      <con1:detail>
        <isl:fault xmlns:isl="http://com.toic.telecom/ISL/ServiceInventoryManagement/queryServiceByService/V4" xmlns:cdm="http://com.toic.telecom/ISL/ServiceInventoryManagement/queryServiceByService/V4/CDM" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
          <cdm:faultCode>concurrentAccessException</cdm:faultCode>
          <cdm:faultString>String</cdm:faultString>
          <cdm:faultActor>String</cdm:faultActor>
          <cdm:detail>
            <cdm:GPELogReference>String</cdm:GPELogReference>
          </cdm:detail>
          <cdm:exception>
            <cdm:code>String</cdm:code>
            <cdm:reason>String</cdm:reason>
            <cdm:actor>String</cdm:actor>
          </cdm:exception>
        </isl:fault>
      </con1:detail>
      <con1:http-response-code>500</con1:http-response-code>
    </con1:ReceivedFaultDetail>
  </con:details>
  <con:location>
    <con:node>PipelinePairNode1</con:node>
    <con:pipeline>PipelinePairNode1_request</con:pipeline>
    <con:stage>stage1</con:stage>
    <con:path>request-pipeline</con:path>
  </con:location>
</con:fault>


Service provide response timeout
$body
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <v4:queryServiceByService xmlns:v4="http://com.toic.telecom/ISL/ServiceInventoryManagement/queryServiceByService/V4" xmlns:cdm="http://com.toic.telecom/ISL/ServiceInventoryManagement/queryServiceByService/V4/CDM">
    <v4:service>
      <!--Optional:-->
      <cdm:serviceId>1111</cdm:serviceId>
      <!--Optional:-->
      <cdm:serviceStatus>string</cdm:serviceStatus>
      <!--Optional:-->
      <cdm:location>
        <!--Optional:-->
        <cdm:placeKey>
          <!--Optional:-->
          <cdm:primaryKey>string</cdm:primaryKey>
        </cdm:placeKey>
      </cdm:location>
      <!--Optional:-->
      <cdm:serviceType>string</cdm:serviceType>
      <!--Optional:-->
      <cdm:serviceNotes>
        <!--Zero or more repetitions:-->
        <cdm:serviceNote>
          <!--Optional:-->
          <cdm:note>string</cdm:note>
        </cdm:serviceNote>
      </cdm:serviceNotes>
    </v4:service>
    <v4:type>string</v4:type>
    <v4:customerAccount>
      <!--Optional:-->
      <cdm:accountId>string</cdm:accountId>
    </v4:customerAccount>
  </v4:queryServiceByService>
</soapenv:Body>

$fault
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
  <con:errorCode>BEA-380000</con:errorCode>
  <con:reason>[WliSbTransports:381304]Exception in HttpOutboundMessageContext.RetrieveHttpResponseWork.run: java.net.SocketTimeoutException
java.net.SocketTimeoutException
            at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse$SocketTimeoutNotification.&lt;clinit>(AsyncResponseHandler.java:555)
            at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse.handleTimeout(AsyncResponseHandler.java:400)
            at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse.timeout(AsyncResponseHandler.java:506)
            at weblogic.socket.SocketMuxer$TimerListenerImpl.timerExpired(SocketMuxer.java:1060)
            at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
            at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)</con:reason>
  <con:location>
    <con:node>PipelinePairNode1</con:node>
    <con:pipeline>PipelinePairNode1_request</con:pipeline>
    <con:stage>stage1</con:stage>
    <con:path>request-pipeline</con:path>
  </con:location>
</con:fault>

Cannot connect to service provide
$body
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v4="http://com.toic.telecom/ISL/ServiceInventoryManagement/queryServiceByService/V4" xmlns:cdm="http://com.toic.telecom/ISL/ServiceInventoryManagement/queryServiceByService/V4/CDM">
  <v4:queryServiceByService>
    <v4:service>
      <!--Optional:-->
      <cdm:serviceId>4321</cdm:serviceId>
      <!--Optional:-->
      <cdm:serviceStatus>?</cdm:serviceStatus>
      <!--Optional:-->
      <cdm:location>
        <!--Optional:-->
        <cdm:placeKey>
          <!--Optional:-->
          <cdm:primaryKey>?</cdm:primaryKey>
        </cdm:placeKey>
      </cdm:location>
      <!--Optional:-->
      <cdm:serviceType>?</cdm:serviceType>
      <!--Optional:-->
      <cdm:serviceNotes>
        <!--Zero or more repetitions:-->
        <cdm:serviceNote>
          <!--Optional:-->
          <cdm:note>?</cdm:note>
        </cdm:serviceNote>
      </cdm:serviceNotes>
    </v4:service>
    <v4:type>?</v4:type>
    <v4:customerAccount>
      <!--Optional:-->
      <cdm:accountId>?</cdm:accountId>
    </v4:customerAccount>
  </v4:queryServiceByService>
</soapenv:Body>

$fault
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
  <con:errorCode>BEA-382501</con:errorCode>
  <con:reason>OSB Service Callout action received an unrecognized response</con:reason>
  <con:details>
    <con1:UnrecognizedResponseDetail xmlns:con1="http://www.bea.com/wli/sb/stages/transform/config">
      <con1:http-response-code>200</con1:http-response-code>
    </con1:UnrecognizedResponseDetail>
  </con:details>
  <con:location>
    <con:node>PipelinePairNode1</con:node>
    <con:pipeline>PipelinePairNode1_request</con:pipeline>
    <con:stage>stage1</con:stage>
    <con:path>request-pipeline</con:path>
  </con:location>
</con:fault>