X

Getting the Fault Payload returned by BPEL Processes in RMI Clients

Ramkumar Menon
Director, Product Strategy

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. }  

Join the discussion

Comments ( 2 )
  • Denis Haselden Thursday, April 28, 2011
    Thank you for sharing with us, I believe this website really stands out : D.
  • best cash isas Friday, April 29, 2011
    I always learn something new from your post!
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.