This discussion is archived
4 Replies Latest reply: Sep 4, 2013 12:24 AM by user12860269 RSS

Webservice Retries

user12860269 Newbie
Currently Being Moderated

Here's my scenario:

 

1. BPELApplicationA : Exposed sync SOAP service. It's a BPEL process, based on the payload it calls external web services. Based on the successful call to external web service it generates FAIL or SUCCESS response for the exposed service.

2. BPELApplicationB : Again it's a BPEL process but it's polling from an Oracle table and calling the BPELApplicationA. If it receives FAIL response from BPELApplicationA it's updating an error table via db adapter.

 

So BPELApplicationB calls BPELApplicationA  which in turns calls external web services.

 

Now when the BPELApplicationA calling the external web service and for some reason the web service is down or unavailable I want to do 3 retries. Even after that it doesn't succeeds then it should fall into

catchAll (which I have added), that in turns generates the FAIL response for the SOAP service.

 

 

I have this fault handling policy attached to BPELApplicationA.

 

 

fault-bindings.xml

<?xml version="1.0" encoding="UTF-8"?>

<faultPolicyBindings xmlns="http://schemas.oracle.com/bpel/faultpolicy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.1">

    <reference faultPolicy="RKWSTestPolicy">

       <name>ExternalServiceNameAAA</name>

    </reference>

</faultPolicyBindings>

 

fault-policy.xml

 

<?xml version="1.0" encoding="UTF-8"?>

<faultPolicies xmlns="http://schemas.oracle.com/bpel/faultpolicy">

  <faultPolicy xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"

               xmlns:xs="http://www.w3.org/2001/XMLSchema"

               xmlns="http://schemas.oracle.com/bpel/faultpolicy"

               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

               version="2.0.1"

               id="RKWSTestPolicy">

    <Conditions>

      <!-- remote fault processing here: -->

      <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension" name="bpelx:remoteFault">

        <condition>

          <action ref="ora-retry"/>

        </condition>

      </faultName>

      <!--binding fault processing here: -->

      <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension" name="bpelx:bindingFault">

        <condition>

          <action ref="ora-retry"/>

        </condition>

      </faultName>

    </Conditions>

    <Actions>

      <!-- RetryInterval is in seconds -->

      <Action id="ora-retry">

        <retry>

          <retryCount>3</retryCount>

          <retryInterval>60</retryInterval>

          <exponentialBackoff/>

          <retryFailureAction ref="ora-rethrow"/>

        </retry>

      </Action>

      <Action id="ora-rethrow">

        <rethrowFault/>

      </Action>

   </faultPolicy>

</faultPolicies>

 

Now I expected that after the retries it will fall into the catchAll which in turn will generate a FAIL response. BPELApplicationB upon receiving the fail response will update the error table and all the instances will be successfully completed.


The issue I have is that in BPELApplicationA after the retries its not going to the catchAll at all. After the rerties its gets faulted, when I look at the trace it says invoke (for the external web service) still pending. BPELApplicationB is not receiving the fail response and it gets faulted as well. Error table doesnt gets updated. Even in BPELApplicationB it doesnt go to the catchAll block. Instances in both the applications are faulted.

 

What I am doing wrong? Any ideas?

 

Thanks for the help in advance.



  • 1. Re: Webservice Retries
    S.Ananth Explorer
    Currently Being Moderated

    What error is captured when BPELApplicationA calls the external web services? Does the error fall under remoteFault?

    bindingFault is not retryable, so the retry action may not be applicable if the web service invocation ends in bindingFault.

  • 2. Re: Webservice Retries
    user12860269 Newbie
    Currently Being Moderated

    The error falls under remoteFault when the web service call fails. If I remove the fault handler, it goes to the catchAll but not when the fault policies are attached.

     

    I want to do the retries then rethrow the fault so that it goes to catchAll where I can use the reply activity to return a FAIL response.

  • 3. Re: Webservice Retries
    Riaan.Ingram Explorer
    Currently Being Moderated

    Hi, If you change the fault policy, you must redeploy the SOA composite application that includes the fault policy.

     

    Did you perhaps add the retryFailureAction later and not redeploy the composite so the fault policy update can take effect?

     

    Validation of fault policy files is done during deployment.

  • 4. Re: Webservice Retries
    user12860269 Newbie
    Currently Being Moderated

    Hi, I did redeploy after every change. I am aware that it will not take any effect without redeploying. Just to be 100% sure I exported the composite from OEM, verified that all the changes are correctly deployed.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points