You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by kodeninja <ko...@gmail.com> on 2009/11/30 09:01:04 UTC

Confusion wrt construct behaviour

Howdy,

I have a faults xsd defined as followed:

Faults XSD (partial):
***************

	<xs:complexType name="MyProductConnectionFault">
	<xs:complexContent>
		<xs:extension base="tns:MyProductFault">
			<xs:sequence/>
		</xs:extension>
	</xs:complexContent>
	</xs:complexType>

	<xs:complexType name="MyProductPartiallyCompleteFault">
		<xs:complexContent>
			<xs:extension base="tns:MyProductFault">
				<xs:sequence/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>


I have the following <invoke> element in my BPEL that has a special handler
for the "MyProductPartiallyCompleteFault" fault:

<invoke> fragment in BPEL:
********************

<invoke name="Create" partnerLink="Create_PL" operation="Create"
portType="create-manager:CreateManagerPortType"
inputVariable="CreateRequest" outputVariable="CreateResponse">
	<ext:failureHandling>
		<ext:faultOnFailure>true</ext:faultOnFailure>
	</ext:failureHandling>
	
	<!-- If a request is only partially successfull, don't retry. -->
	<ns1:catch faultName="ns3:MyProductPartiallyCompleteFault">
		<!-- Do something here -->
	</ns1:catch>

        <ns1:catchAll>
		<!-- Do something here -->
        </ns1:catchAll>

</invoke>

Below is the exception the BPEL receives when the "Create" operation throws
a connection exception wrapped as a "MyProductConnectionFault" fault:

Exception in BPEL:
**************

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse</wsa:Action><wsa:RelatesTo>uuid:hqejbhcnphr4sjd44c2461</wsa:RelatesTo></soapenv:Header><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>com.xyz.myproduct.MyProductConnectionFault:
java.net.ConnectException: Connection refused:
connect</faultstring><detail><ns3:MyProductConnectionFault
xmlns:ns3="http://xyz.com/myproduct/core-fault"
xmlns:ns4="http://xyz.com/myproduct/1.0"
xmlns:ns5="http://user.xyz.com/user-data"
xmlns:ns2="http://xyz.com/myproduct/core"
xmlns:ns7="http://schemas.xmlsoap.org/ws/2004/09/transfer"
xmlns:ns6="http://www.w3.org/2005/08/addressing"><exceptionInString>com.xyz.myproduct.MyProductConnectionException:
com.xyz.myproduct.MyProductConnectionFault: java.net.ConnectException:
Connection refused: connect&#xd;

Now, what I'm observing here is that even though the exception/fault thrown
is not "MyProductPartiallyCompleteFault", it's the <catch> element that's
getting executed, instead of the <catchAll> element.

Can anyone explain why this is happening? Why is the BPEL executing the
<catch faultName="ns3:MyProductPartiallyCompleteFault"> construct for a
"MyProductConnectionFault" fault?

Thanks,
-kodeninja
-- 
View this message in context: http://old.nabble.com/Confusion-wrt-%3Ccatch%3E-construct-behaviour-tp26570563p26570563.html
Sent from the Apache Ode User mailing list archive at Nabble.com.