On Sun, Aug 24, 2008 at 9:38 AM, seriousme <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> trying to throw a fault inside a process it appears that it is never caught
> even with a "catchAll" activity.
>
> This very basic process shows the problem :
> <?xml version="1.0" encoding="utf-8" ?>
> <wsbpel:process
>        name="testerProcess"
>
>        xmlns:wsbpel="
> http://docs.oasis-open.org/wsbpel/2.0/process/executable";
>
>        targetNamespace="http://services";
>        xmlns:tns="http://services";
> >
>
>        <wsbpel:import importType="http://schemas.xmlsoap.org/wsdl/";
> location="tester.wsdl"  namespace="http://services"; />
>
>        <wsbpel:partnerLinks>
>                <wsbpel:partnerLink name="linkToClient"
> partnerLinkType="tns:testerLinkType"    myRole="tester"/>
>        </wsbpel:partnerLinks>
>
>        <wsbpel:variables>
>                <wsbpel:variable        name="input"
>  messageType="tns:testInput" />
>                <wsbpel:variable        name="output"
> messageType="tns:testOutput" />
>        </wsbpel:variables>
>
>        <wsbpel:faultHandlers>
>                <!--<wsbpel:catch faultName="fault0">
>                        <wsbpel:assign>
>                                <wsbpel:copy>
>                                        <wsbpel:from>'fault0
> caught'</wsbpel:from>
>
>  <wsbpel:to>$output.result</wsbpel:to>
>                                </wsbpel:copy>
>                        </wsbpel:assign>
>                        <wsbpel:reply partnerLink="linkToClient"
> portType="tns:testerPortType"
> operation="test" variable="output" />
>                </wsbpel:catch>
>                <wsbpel:catch faultName="fault1">
>                        <wsbpel:assign>
>                                <wsbpel:copy>
>                                        <wsbpel:from>'fault1
> caught'</wsbpel:from>
>
>  <wsbpel:to>$output.result</wsbpel:to>
>                                </wsbpel:copy>
>                        </wsbpel:assign>
>                        <wsbpel:reply partnerLink="linkToClient"
> portType="tns:testerPortType"
> operation="test" variable="output" />
>                </wsbpel:catch>-->
>                <wsbpel:catchAll>
>                        <wsbpel:assign>
>                                <wsbpel:copy>
>                                        <wsbpel:from>'fault
> caught'</wsbpel:from>
>
>  <wsbpel:to>$output.result</wsbpel:to>
>                                </wsbpel:copy>
>                        </wsbpel:assign>
>                        <wsbpel:reply partnerLink="linkToClient"
> portType="tns:testerPortType"
> operation="test" variable="output" />
>                </wsbpel:catchAll>
>        </wsbpel:faultHandlers>
>
>        <wsbpel:sequence>
>                <wsbpel:receive createInstance="yes"
> partnerLink="linkToClient"
> portType="tns:testerPortType" operation="test" variable="input" />
>
>                <wsbpel:if>
>                        <wsbpel:condition>string($input.data) =
> '0'</wsbpel:condition>
>                        <wsbpel:then>
>                                <wsbpel:throw faultName="fault0" />
>                        </wsbpel:then>
>                        <wsbpel:elseif>
>                                <wsbpel:condition>string($input.data) =
> '1'</wsbpel:condition>
>                                <wsbpel:throw faultName="fault1" />
>                        </wsbpel:elseif>
>                        <wsbpel:else>
>                                <!--<wsbpel:throw faultName="fault2" />-->
>                                <wsbpel:empty/>
>                        </wsbpel:else>
>                </wsbpel:if>
>                <wsbpel:assign>
>                        <wsbpel:copy>
>                                <wsbpel:from>'Test'</wsbpel:from>
>                                <wsbpel:to>$output.result</wsbpel:to>
>                        </wsbpel:copy>
>                </wsbpel:assign>
>                <wsbpel:reply partnerLink="linkToClient"
> portType="tns:testerPortType"
> operation="test" variable="output" />
>        </wsbpel:sequence>
>
> </wsbpel:process>
>
> When invoked with a value that provoke an exception, that is "0" and "1",
> nothing is replied to the client and the process seems to do nothing.
> The behavior is normal when invoked with other values, that is the value
> 'Test' is returned.
>
> The problem comes, of course, from the misuse of the "throw...catch"
> feature, particularly from the non definition of the faults.
>
> So two questions :
> Is there a way to throw anonymous, that is non defined, fault the way it is
> done in this process ?


Have you tried using a qualified name for your fault? We have some working
tests using non-declared faults:

http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestCatchFaultInFaultHandler/

Cheers,
Matthieu


>
> If not, how to properly use the WS-BPEL throw-catch construct, particularly
> how to declare the faults which names will go into "faultName" attribute of
> the "throw" and "catch" ?
>
> Thanks by advance for your help.
> --
> View this message in context:
> http://www.nabble.com/How-to-throw-an-anonymous-fault---tp19132119p19132119.html
> Sent from the Apache Ode User mailing list archive at Nabble.com.
>
>

Reply via email to