« Why doesnt my XPath work with unprefixed path elements? | Main | Specifying null content in your XML Document using nillable and xsi:nil »

Getting the Fault Payload returned by BPEL Processes in RMI Clients

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.






  1.   
  2. import oracle.xml.parser.v2.XMLElement;   
  3. import com.oracle.bpel.client.ServerException;   
  4. import com.oracle.bpel.client.BPELFault;   
  5. try {   
  6.   
  7.     //invoke the BPEL process using the DeliveryService API.   
  8.   
  9. }catch(ServerException ex) {   
  10.   
  11.   Throwable t = ex.getCause();   
  12.   
  13.   
  14.   if(t instanceof BPELFault)  {   
  15.   
  16.     BPELFault fault = (BPELFault)t;   
  17.     //in the line below, "payload" is the name of the message part.   
  18.     //replace it with the part name that you have defined in the WSDL.   
  19.     //if its a runtime fault, refer to RuntimeFault.wsdl to obtain the   
  20.     //part name. In that case, the payload will be a string value.   
  21.   
  22.   
  23.     XMLElement faultPayload = (XMLElement)fault.getPart("payload");   
  24.   
  25.   
  26.     //do processing with payload   
  27.   
  28.   }   
  29.   
  30.   
  31. }  

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on September 28, 2007 1:32 PM.

The previous post in this blog was Why doesnt my XPath work with unprefixed path elements?.

The next post in this blog is Specifying null content in your XML Document using nillable and xsi:nil.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle