1

I've the following scenario:

enter image description here

To simplify, let's say that DBAdapter1 deletes records from a database table and DBAdapter2 (invoked through OSB proxy) inserts a record in a different table. I want to be able to rollback the first DBAdapter invocation in case of a failure in the 2nd one.

Within a BPEL process I'm invoking DBAdapter1 and an OSB Proxy using SOADIRECT. My bpel process has transaction=REQUIRED.

In the OSB Proxy, I'm setting TransactionRequired=ENABLED in message handling tab, as well as setting QOS as 'EXACTLY-ONCE' in the Route activity to invoke DBAdapter2.

This configuration works fine, i.e., if an error occurs in DBAdapter2 (or osb proxy), all the transaction is rolled back, however I'm not able to send the fault back from OSB Proxy to BPEL. BPEL Invoke will finish with:

oracle.soa.api.invocation.InvocationException: com.bea.wli.sb.transports.client.SBTransportException: A Transport Exception occurred during an SB Transport message processing.
JTA transaction is not in active state.

which doesn't seems to make any sense for me, because OSB Proxy shouldn't end the global transaction initiated in BPEL. If I add an Error Handler in my proxy service, I can capture the proper error coming from the DBAdapter2, however this fault is never propagated back to BPEL.

Any idea what am I doing wrong here? How can I propagate transactions and faults using soadirect from osb to bpel?

Thanks,

Fabio
  • 59
  • 2
  • 13

2 Answers2

1

Try this. use a split/join in between your proxy and dbAdapter and throw a customized fault inside the split/Join where you invoke your adapter.

in the error handler define a faultvariable and in the reply say "propagate soap fault"

You will receive the fault element if you test your proxy now.

let me know.!

image

Inspector Squirrel
  • 2,548
  • 2
  • 27
  • 38
spattanaik75
  • 143
  • 9
-1

I only get the error: oracle.soa.api.invocation.InvocationException: com.bea.wli.sb.transports.client.SBTransportException: A Transport Exception occurred during an SB Transport message processing. when there is not a proper SOAP fault being returned from the OSB service back to BPEL.

If a properly formed SOAP fault is returned back to SOA, you can see the fault in the BPEL instance. and can catch the fault based on element type.

The SOAP Fault must provide a faultcode value which contains a qualified element name referencing the wsdl:portType>wsdl:operation>wsdl:fault element from the WSDL. If this is not correct then, BPEL will show a fault from the service invoked, but the fault message part will not be populated.

See WSDL:

<wsdl:definitions name="Update_direct" 
targetNamespace="http://oracle.com/sca/soapservice/TransactionPropPOC/TransactionPropPOC/Update_direct"
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
 xmlns:inp1="http://xmlns.oracle.com/pcbpel/adapter/db/Update_Direct" 
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
 xmlns:tns="http://oracle.com/sca/soapservice/TransactionPropPOC/TransactionPropPOC/Update_direct">

<wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:import namespace="http://xmlns.oracle.com/pcbpel/adapter/db/Update_Direct" schemaLocation="UpdateExternal.xsd"/>
    </xsd:schema>
</wsdl:types>
<wsdl:message name="requestMessage">
    <wsdl:part name="UpdateInput_msg" element="inp1:UpdateInput"/>
</wsdl:message>
<wsdl:message name="response_msg">
    <wsdl:part name="response_msg" element="inp1:Response"/>
</wsdl:message>
<wsdl:message name="faultResponse">
    <wsdl:part name="faultResponsePart" element="inp1:FaultResponse"/>
</wsdl:message>

<wsdl:portType name="Update_ptt">
    <wsdl:operation name="Update">
        <wsdl:input message="tns:requestMessage"/>
        <wsdl:output message="tns:response_msg"/>
        <wsdl:fault message="tns:faultResponse" name="FaultResponseMsg"/>
    </wsdl:operation>
</wsdl:portType>

<wsdl:binding name="UpdateBinding" type="tns:Update_ptt">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Update">
  <soap:operation style="document" soapAction="http://service.example.co.uk/update"/>
  <wsdl:input>
    <soap:body use="literal" parts="UpdateInput_msg"/>
  </wsdl:input>   
   <wsdl:output>
    <soap:body use="literal" parts="response_msg"/>
  </wsdl:output>
  <wsdl:fault name="FaultResponseMsg">
    <soap:fault name="FaultResponseMsg" use="literal"/>
  </wsdl:fault>
</wsdl:operation>

See Fault Response:

<env:Body xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Fault xmlns:flt="http://oracle.com/sca/soapservice/TransactionPropPOC/TransactionPropPOC/Update_direct">
  <faultcode>flt:FaultResponseMsg</faultcode>
  <faultstring>SOAP Fault String</faultstring>
  <faultactor>SOAP Fault Actor</faultactor>
  <detail>
    <ns0:FaultResponse xmlns:ns0="http://xmlns.oracle.com/pcbpel/adapter/db/Update_Direct">
        <ns0:Status>KO</ns0:Status>
    </ns0:FaultResponse>
  </detail>
</env:Fault>

Adam H
  • 1
  • 1