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 <[email protected]> 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: [email protected], [email protected] Blog: http://mpathirage.com
