15 Accessing Data on Oracle Cloud

This chapter describes how an ADF Mobile application can access data hosted on Oracle Java Cloud Service

15.1 Enabling ADF Mobile Applications to Access Data Hosted on Oracle Cloud

ADF Mobile applications can access both SOAP and REST web services hosted on Oracle Cloud. To enable access to the hosted SOAP web services, create a web service data control as described in Section 10.2, "Creating a Web Service Data Control." You can enable access to RESTful web services by creating a URL Service data control as described in the "Exposing URL Services with ADF Data Controls" section in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework. Depending on the content type, ADF Mobile applications can access cloud data by dragging and dropping a data control into an ADF Mobile AMX UI component, as described in Section 7.3.2, "How to Add UI Components and Data Controls to an ADF Mobile AMX Page," or programmatically, for applications whose content is delivered from a either a remote web server, or from locally stored HTML files.

15.1.1 How to Authenticate Against Oracle Cloud

You use the ADF Mobile Login Server Connection dialog to create a login server connection to authenticate against Oracle Cloud.

Before you begin:

Obtain the Oracle Cloud URL that is used for the login server connection.

To create a login URL with an Oracle Cloud endpoint:

  1. Select Application, then New, and then Connections.

  2. Select ADF Mobile Server Login Connection.

  3. Complete the Connect ADF Mobile Login Connection dialog, shown in Figure 15-1, by entering the following:

    • A name for the connection in the Name field.

    • The URL for Oracle Cloud in the Login URL field.

    For more information, refer to the Oracle JDeveloper online help and Section 17.4.2, "How to Designate the Login Page."

    Figure 15-1 Creating the Login to Oracle Cloud

    Enter the Oracle Cloud login URL.

15.1.2 How to Create a Web Service Data Control to Access Oracle Java Cloud

The Create Data Service Control Wizard enables you to create the data control that accesses the hosted data. You use the WSDL URL of the SOAP web service deployed to Oracle Java Cloud to create this data control. If you do not know this URL, then you must create the URL to the WSDL document by appending the web service port name and ?wsdl to the application context root.

Before you begin:

You must have access to a SOAP web service application that has been deployed to Oracle Java Cloud Service. This application must be available through the Applications pane of the Oracle Java Cloud Service Control home page. In addition, its Status and State must be noted as both Up and Active, respectively, as illustrated by the HCMMobileService application shown in Figure 15-2.

Figure 15-2 The Java Cloud Services Control Home Page

SOAP web service must be up and active.

To create a web service data control:

  1. Obtain the application context root of the web service hosted on Oracle Cloud as follows:

    1. Traverse to the application home page, shown in Figure 15-3, by clicking the application in the Applications pane (shown in Figure 15-2).

    2. Copy the URL, as shown in Figure 15-3. This URL is the application context root of the WSDL document.

      Figure 15-3 Copying the Web Service Application Context Root

      Copy the application context root.
  2. In JDeveloper, right-click the view controller project in the Application Navigator and then open the Create Web Service Data Control Wizard, as described in Section 10.2, "Creating a Web Service Data Control."

  3. In the Data Source page, shown in Figure 15-4, enter the name of the data control.

    Figure 15-4 Entering the URL for the WSDL Document

    Enter the WSDL URL.
  4. In the URL field, paste the URL of the SOAP-based web service that is deployed to (and currently running on) Oracle Cloud Java Service.

  5. Enable the data control to access the WSDL by appending a web service port name and ?wsdl to the application context root, such as HCMServicePort?wsdl in Figure 15-4.

  6. In the Data Controls Operations page, shown in Figure 15-5, select from among the web service operations that can be used by the application feature to retrieve data. Click Finish.

    Figure 15-5 Selecting the Web Service Operations

    Select the returned web service operations.

    Figure 15-5 shows the web service operations returned by the ADF Mobile design time that can be made available to the ADF Mobile application. In this example, the design time has queried a web service that hosts human resources data and has returned operations to retrieve employee data, including expense approvals.

15.1.2.1 Configuring the Policy for SOAP-Based Web Services

You must configure a policy for a SOAP-based web service that is secured on Oracle Cloud. Using the Edit Data Service Control Policies dialog, described at Section 10.5, "Accessing Secure Web Services," you can select the oracle/wss_http_token_over_ssl_client_policy. See also the "How to Define Web Service Data Control Security" section in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

Note:

Only the oracle/wss_http_token_over_ssl_client_policy is supported for SOAP-based web services. For RESTful web services, basic authentication or SSL policies are supported.

15.1.3 What Happens When You Deploy an ADF Mobile Application that Accesses Oracle Java Cloud Service

After you deploy the application, the operations of the web service data control retrieve the data from a web service running on the Oracle Java Cloud Service instance.