Hi Mark,

I cannot access the contents of the fault message. I tried in several
ways but I without succeded. Could you please help me?

Im sending you my BPEL file and the WSDL that defines the fault.

Or if you have a link with an example it would be excellent.

Thanks in advance.



2009/7/30 Ford, Mark <[email protected]>:
> There are three types of faults:
>
>  *   standard BPEL faults like bpel:selectionFailure. These typically 
> indicate a problem in your process where you've not implemented something 
> correctly
>  *   custom faults that you throw internally with the bpel:throw activity. 
> This can be any type of xml data you want.
>  *   faults resulting from web service invokes. The fault will be defined on 
> the operation that you're invoking. An operation may define multiple faults.
>
> 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.
>
> On 7/30/09 3:11 AM, "kodeninja" <[email protected]> wrote:
>
>
>
> Thanks for the pointer, Nelson. However, I'm still not clear on how to catch
> hold of the actual exception trace/error code etc from the fault variable.
> How to access that?
>
> -Kodeninja
> --
> View this message in context: 
> http://www.nabble.com/How-to-use-the-%3Ccatch%3E-element-in-BPEL--tp24719833p24733273.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
>



-- 
Atentamente

L.I. José Augusto Díaz Noriega
<?xml version="1.0"?>
<definitions name="FaultH"
        targetNamespace="http://efs.ge.com/bpel/faultH";
        xmlns:tns="http://efs.ge.com/bpel/faultH";
        xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype";
        xmlns="http://schemas.xmlsoap.org/wsdl/";
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:p="http://www.w3.org/2001/XMLSchema";>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     TYPE DEFINITION - List of types participating in this BPEL process 
     The BPEL Designer will generate default request and response types
     but you can define or import any XML Schema type and use them as part 
     of the message types.
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->    
    <types>
        <schema attributeFormDefault="unqualified" elementFormDefault="qualified" 
                targetNamespace="http://efs.ge.com/bpel/faultH"; 
                xmlns="http://www.w3.org/2001/XMLSchema";>

            <element name="FaultHRequest">
                <complexType>
                    <sequence>
                        <element name="input" type="string"/>
                    </sequence>
                </complexType>
            </element>

            <element name="FaultHResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="string"/>
                    </sequence>
                </complexType>
            </element>
            <element name="MyFault">
            	<complexType>
            		<sequence>

            			<element name="myError" type="string"></element>
            		</sequence>
            	</complexType>
            </element>
            <element name="check">
            	<complexType>
            		<sequence>

            			<element name="in" type="string"></element>
            		</sequence>
            	</complexType>
            </element>
            <element name="checkResponse">
            	<complexType>
            		<sequence>

            			<element name="out" type="string"></element>
            		</sequence>
            	</complexType>
            </element>
            <element name="check_fault">
            	<complexType>
            		<sequence>

            			<element name="check_fault" type="string"></element>
            		</sequence>
            	</complexType>
            </element>
        </schema>
    </types>


<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     MESSAGE TYPE DEFINITION - Definition of the message types used as 
     part of the port type defintions
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->    
    <message name="FaultHRequestMessage">
        <part name="payload" element="tns:FaultHRequest"/>
    </message>
    <message name="FaultHResponseMessage">
        <part name="payload" element="tns:FaultHResponse"/>
    </message>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     PORT TYPE DEFINITION - A port type groups a set of operations into
     a logical service unit.
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->    

    <!-- portType implemented by the FaultH BPEL process -->
    <message name="FaultMessage">
    	<part name="payload" element="tns:MyFault"></part>
    </message>
    <message name="checkRequest">
    	<part name="parameters" element="tns:check"></part>
    </message>
    <message name="checkResponse">
    	<part name="parameters" element="tns:checkResponse"></part>
    </message>
    <message name="check_faultMsg">
    	<part name="parameters" element="tns:check_fault"></part>
    </message>
    <portType name="FaultH">
        <operation name="process">
            <input  message="tns:FaultHRequestMessage" />
            <output message="tns:FaultHResponseMessage"/>
            <fault name="fault" message="tns:FaultMessage"></fault>
        </operation>
        <operation name="check">
        	<input message="tns:checkRequest"></input>
        	<output message="tns:checkResponse"></output>
            <fault name="fault" message="tns:check_faultMsg"></fault>
        </operation>
    </portType>
  

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     PARTNER LINK TYPE DEFINITION
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->    
    <plnk:partnerLinkType name="FaultH">
        <plnk:role name="FaultHProvider" portType="tns:FaultH"/>
    </plnk:partnerLinkType>
    
    <binding name="FaultBinding" type="tns:FaultH">

    	<soap:binding style="document"
    		transport="http://schemas.xmlsoap.org/soap/http"; />
    	<operation name="process">

    		<soap:operation
    			soapAction="http://efs.ge.com/bpel/faultH/process"; />
    		<input>

    			<soap:body use="literal" />
    		</input>
    		<output>

    			<soap:body use="literal" />
    		</output>
    		<fault name="fault">

    			<soap:fault use="literal" name="fault" />
    		</fault>
    	</operation>
    	<operation name="check">
    		<soap:operation
    			soapAction="http://efs.ge.com/bpel/faultH/check"; />
    		<input>
    			<soap:body use="literal" />
    		</input>
    		<output>
    			<soap:body use="literal" />
    		</output>
    		<fault name="fault">
    			<soap:fault use="literal" name="fault" />
    		</fault>
    	</operation>
    </binding>
    <service name="FaultService">
    	<port name="FaultPort" binding="tns:FaultBinding">
    		<soap:address location="http://localhost:8080/ode/processes/fault";></soap:address>
    	</port>
    </service>
</definitions>

Reply via email to