ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ford, Mark" <mark.f...@ll.mit.edu>
Subject Re: How to use the <catch> element in BPEL?
Date Fri, 31 Jul 2009 12:50:03 GMT
The output variable will not get initialized by the invoke if it faults.

I'm not sure what you mean by "fault string" - again, it sounds like a SOAP term. WS-BPEL
gives you access to the fault message (as in wsdl:message) or fault element (as in the element
defined in the wsdl:message/wsdl:part for the wsdl:fault), depending on how you define the
catch. I suggest you read through the WSDL spec to get a better understanding of how faults
are defined on operations. WSDL relies on XSD to define the structure of the messages and
faults it sends and receives. If you want your process to be able to get a stacktrace or error
string, then you'll need to have the fault modeled to contain the string somewhere in its
contents. For example, something like this:

<ns:invalidOrderFault ...>
   <ns:message>Order was invalid due to errors in one or more fields. Please correct
and resubmit</ns:message>
   <ns:exception> ... Some big stacktrace </ns:exception>
   <ns:errorFields>
      <ns:field name="sku">Stock number not found in inventory</ns:field>
      ...
   </ns:errorFields>
</ns:invalidOrderFault>




On 7/31/09 2:52 AM, "kodeninja" <koffee.2.kode@gmail.com> wrote:



Hi Mark,

Yes, this is exactly what I'm looking for. Just for clarity, if I invoke an
operation that has both input and output variables, and if it throws an
exception, then the output variable would be null, right? And if I'll be
able to access the exception/fault variable only in the specific catch
block, would I be able to get the actual fault string there?

-Kodeninja


mark.ford wrote:
>
> It sounds like you're asking how to access the SOAP fault from an invoke.
> The short answer is that there is nothing in the spec about SOAP and there
> are no built in functions to access the faultCode, faultActor, or
> faultString.
>
> The typical use case here is to define a catch for each fault that is
> defined on the operation you're invoking. Make sure the name and the fault
> message/element matches what's defined in the WSDL for the operation. Each
> catch defined in this way serves as a declaration of a variable of that
> message/element that is scoped to that catch. When the catch executes, you
> can access the contents of the fault message/element just like any other
> variable. Keep in mind, the contents of this variable will be limited to
> what's defined in the WSDL. If you're familiar with SOAP, then it's
> probably the first child element of the fault detail element.
>

--
View this message in context: http://www.nabble.com/How-to-use-the-%3Ccatch%3E-element-in-BPEL--tp24719833p24751923.html
Sent from the Apache Ode User mailing list archive at Nabble.com.





--
Mark Ford
MIT Lincoln Laboratory
244 Wood Street
Lexington MA 02420
(781) 981-1843

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message