Assume that you have a BPEL Process that returns a Fault may it be business or runtime.
Your RMI Client can receive the payload of the faults from the BPEL Processes by using the snippet below.
-
- import oracle.xml.parser.v2.XMLElement;
- import com.oracle.bpel.client.ServerException;
- import com.oracle.bpel.client.BPELFault;
- try {
-
- //invoke the BPEL process using the DeliveryService API.
-
- }catch(ServerException ex) {
-
- Throwable t = ex.getCause();
-
-
- if(t instanceof BPELFault) {
-
- BPELFault fault = (BPELFault)t;
- //in the line below, "payload" is the name of the message part.
- //replace it with the part name that you have defined in the WSDL.
- //if its a runtime fault, refer to RuntimeFault.wsdl to obtain the
- //part name. In that case, the payload will be a string value.
-
-
- XMLElement faultPayload = (XMLElement)fault.getPart("payload");
-
-
- //do processing with payload
-
- }
-
-
- }
import oracle.xml.parser.v2.XMLElement; import com.oracle.bpel.client.ServerException; import com.oracle.bpel.client.BPELFault; try { //invoke the BPEL process using the DeliveryService API. }catch(ServerException ex) { Throwable t = ex.getCause(); if(t instanceof BPELFault) { BPELFault fault = (BPELFault)t; //in the line below, "payload" is the name of the message part. //replace it with the part name that you have defined in the WSDL. //if its a runtime fault, refer to RuntimeFault.wsdl to obtain the //part name. In that case, the payload will be a string value. XMLElement faultPayload = (XMLElement)fault.getPart("payload"); //do processing with payload } }