5 Replies Latest reply on Nov 16, 2012 11:18 PM by Joe Huang-Oracle

    ADF Mobile and Web Services

      Using JDev I created a soap web service from an ADF BC App Module and ViewObject, deployed it to a server and tested it. Everything worked fine.

      I then went to another machine and using JDev I created an ADF Mobile application that consumed the web service - by creating a Web Service Data Control - and everything worked fine.

      Then I went back to the first machine and updated the soap web service, adding a new operation. I deployed it on a server and tested it and again everything is fine.

      Then I went back to the second machine and tried to update the Web Service Data Control to understand the new operation but could not figure out how to do it.

      I imagine this is a fairly simple operation. Can someone let me know how to update the Web Service Data Control in the client so that it exposes the new operation that I added?
        • 1. Re: ADF Mobile and Web Services
          Shay Shmeltzer-Oracle
          There isn't exactly an update option for the Web service data control - you need to re-create it if you changed the WSDL.
          • 2. Re: ADF Mobile and Web Services
            Does that mean I have to recreate my mobile application? I don't see any way to delete and recreate just the web service data control.
            • 3. Re: ADF Mobile and Web Services

              it means, you have to re-create your web service data control.
              Just create a new web service data control and give it exact the same name as the existing one.
              You will be asked by Jdev whether to update/override the existing one.

              I have found that also the re-creation of the web service data control does not work as expected.
              E.g. new methods exposed in the service interface are not listed in the available methods in the web service re-creation process.
              A dummy-update (e.g. remove or add a already existing method from the web service data control) is needed.
              After this a subsequent re-creation of the web service data controll will list the new exposed methods.
              Bug 15853883 has been created for this.

              hope this helps

              • 4. Re: ADF Mobile and Web Services
                Thank you very much, that does help.

                Edited by: larry.phillips on Nov 16, 2012 8:51 AM
                • 5. Re: ADF Mobile and Web Services
                  Joe Huang-Oracle
                  Hi, Larry,

                  As a matter of best practice, although it's more work, generally you would want to leverage a programmatic approach to invoke these web services in ADF Mobile applications. In other words, the general pattern is like this:

                  - You create a set of Java Objects that correspond to your data model. For example, for a web service that returns a list of employees, create a "Data POJO" with the corresponding attributes. Shay's video (http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/adfmobiledemo/adfmobiledemo.html) goes through how to create these data objects.

                  - You then create a set of "Factory" POJOs that instantiate and populate the data objects. Use the examples and helper classes described in this article (https://blogs.oracle.com/mobile/entry/web_services_example_part_2) to invoke web services and convert data into Java Objects.

                  - You can then create Bean Data Control based on these POJOs. This is what you bind your user interface to.

                  This gives you more flexibility when dealing with Web Services changes, as well as adding code to, for example, more gracefully handle lack of network connectivity or validate user input prior to invoking the web services.

                  BTW because the embedded JVM is based on JavaME CDC spec, there is no Java Web Services Proxy support. There are helper classes however that would allow you to invoke Web Services Data Controls as described above.

                  Virtually of all the ADF Mobile beta participants went with similar approach - only difference is whether they are invoking SOAP or JSON-based services, or if these data come from local database.


                  Joe Huang