ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From LeeCK <leechin_k...@yahoo.com>
Subject Re: How to handle soap fault
Date Mon, 07 Sep 2009 06:50:31 GMT

Hi Milinda,

I've tried to use <faultHandlers><catchAll>...</catchAll></faultHandlers>
to
catch the soap fault, but nothing has been caught. That is when i found out
that the soap fault has been written into the invoke's outputVariable.

Is this a correct behaviour? How can I stop <invoke> writing the soap fault
into the outputVariable?



Milinda Pathirage wrote:
> 
> You can use fault handlers to implement your requirements. Please have
> look
> at the fault handling section of BPEL specification and fault handling
> tests
> come with Apache ODE tests. You can find tests at
> 'bpel-test/src/test/resources/bpel/2.0' directory of Apache ODE trunk
> source.
> 
> Thanks
> Milinda
> 
> On Mon, Sep 7, 2009 at 11:11 AM, LeeCK <leechin_kong@yahoo.com> wrote:
> 
>>
>> Hi,
>>
>> When invoking the bpel script below, I was expecting the invoke script to
>> throw an exception when there's a soap fault so that I can catch the soap
>> fault and report the error to the user. But no exception was thrown and
>> the
>> soap fault is written into the addUserToGroupResponse variable. What did
>> I
>> do wrong? How can I force the invoke script to throw an exception when
>> soap
>> fault is received? Is there another way to handle soap fault? Please
>> help.
>> Thanks.
>>
>> Bpel script:
>>    <variables>
>>        <variable name="addUserToGroupRequest"
>> messageType="ssdir:AddUserToGroupSoapIn"/>
>>        <variable name="addUserToGroupResponse"
>> messageType="ssdir:AddUserToGroupSoapOut"/>
>>    </variables>
>>
>>    <sequence>
>>        <invoke name="invokeAddUserToGroupOperation"
>>                operation="AddUserToGroup"
>>                inputVariable="addUserToGroupRequest"
>>                outputVariable="addUserToGroupResponse"
>>                partnerLink="mossUserGroupPartnerLink"
>>                portType="ssdir:UserGroupSoap">
>>        </invoke>
>>    </sequence>
>>
>> Wsdl:
>>  <wsdl:types>
>>    <s:schema
>> targetNamespace="http://schemas.microsoft.com/sharepoint/soap/directory/">
>>      <s:element name="AddUserToGroupResponse">
>>        <s:complexType />
>>      </s:element>
>>    </s:schema>
>>  </wsdl:types>
>>  <wsdl:message name="AddUserToGroupSoapOut">
>>    <wsdl:part name="parameters" element="tns:AddUserToGroupResponse" />
>>  </wsdl:message>
>>
>> Soap envelope returns by endpoint:
>>   <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>>      <soap:Body>
>>         <soap:Fault>
>>            <soap:Code>
>>               <soap:Value>soap:Receiver</soap:Value>
>>            </soap:Code>
>>            <soap:Reason>
>>               <soap:Text xml:lang="en">Exception of type
>> 'Microsoft.SharePoint.SoapServer.SoapServerException' was
>> thrown.</soap:Text>
>>            </soap:Reason>
>>            <detail>
>>               <errorstring
>> xmlns="http://schemas.microsoft.com/sharepoint/soap/">Group cannot be
>> found.</errorstring>
>>               <errorcode
>> xmlns="http://schemas.microsoft.com/sharepoint/soap/
>> ">0x80131600</errorcode>
>>            </detail>
>>         </soap:Fault>
>>      </soap:Body>
>>   </soap:Envelope>
>>
>> Content of addUserToGroupResponse after invoke is called:
>>            <soap:Code>
>>               <soap:Value>soap:Receiver</soap:Value>
>>            </soap:Code>
>>            <soap:Reason>
>>               <soap:Text xml:lang="en">Exception of type
>> 'Microsoft.SharePoint.SoapServer.SoapServerException' was
>> thrown.</soap:Text>
>>            </soap:Reason>
>>            <detail>
>>               <errorstring
>> xmlns="http://schemas.microsoft.com/sharepoint/soap/">Group cannot be
>> found.</errorstring>
>>               <errorcode
>> xmlns="http://schemas.microsoft.com/sharepoint/soap/
>> ">0x80131600</errorcode>
>>            </detail>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-handle-soap-fault-tp25325263p25325263.html
>> Sent from the Apache Ode User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Milinda Pathirage
> Senior Software Engineer & Project Lead; WSO2 BPS; http://wso2.org/bps
> WSO2 Inc.; http://wso2.com
> E-mail: milinda@wso2.com, milinda.pathirage@gmail.com
> Blog: http://mpathirage.com
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-handle-soap-fault-tp25325263p25325748.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Mime
View raw message