Shay Shmeltzer's Oracle Development Tools Tips

Web Service Across Pages Called Twice

Shay Shmeltzer
Director of Product Management - Oracle

I first ran into this little trickery a few weeks back while helping some internal team with a POC, then yesterday this popped up again in another scenario, so here is a little thing that is a very common mistake when you first start to work with the ADF Data control.

The scenario is that you add a parameter page for the Web service in a JSF and a button that calls the Web service, and then you navigate to another page to show the results.

If your results are a collection of data, if you'll look carefully you'll notice that the Web service is actually invoked twice.

Once from the button, but then another time in a hidden way in the results page.

One thing you might encounter then is that the results that actually show up on the results page don't match your original parameters.

The solution is to have the first page just set the parameters and then pass them to the second page - where they are going to be used in the call to the Web service.

Here is a short demo that might make this clearer:

Join the discussion

Comments ( 4 )
  • Tim Lehming Friday, November 11, 2011

    Hey there,

    i got the same problem with the only difference, that I'm using only one page. I want to display the results directly under the ADF Form.

    But the problem is, that I cant use this workarround, because the output fields are on the same page.

    It everytime invokes the webservice after rendering the page. All output fields are updated after pressig the "submit"-button. (sending the parameters to the webservice and receive the response)

    I tried a lot of stuff to avoid the first invoke, but I dont found out, how this setup can work.

    Do you maybe have a solution for it?

    Thanks in advance!

    Best Regards

    Tim Lehming

  • guest Friday, November 11, 2011

    Tim - see if this type of solution will help preventing the initial execution of the Web service on your page: http://blogs.oracle.com/shay/entry/delay_method_execution_when_us

  • Tim Lehming Thursday, November 24, 2011


    thanks! That helped me a lot!

    Best Regards

    Tim Lehming

  • Americo Antunes Monday, December 29, 2014

    Thanks ! all your posts helps me a lot! God bless you.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.