Working with Web Services in the Model Project

This topic assumes you have followed the steps in Creating Business Services for the Model Project and chosen web services as your business service technology.

You can use the functionality of either web services which you create in JDeveloper, or you can use an external web service which may be anywhere on the Web.

To use web services in your application:

  1. If necessary, create and deploy a new web service.
  2. Register the web service with the Oracle ADF data controls in order to create a databound application client.
  3. Create a Struts page flow and create either JSP or UIX pages for your ViewController project.

Additional Information for Working with Web Services

This section contains additional information about using web services with an Oracle ADF application.

Adding the Web Services Technology Scope to an Application Template or to a Project

You can use web services in any kind of application built using the Oracle ADF framework by adding the web services technology scope to:

To add the web service technology to an application template:

  1. Right-click the Applications node in the Application Navigator and choose New Ap plication Workspace.
  2. In the Create Application Workspace dialog, click Manage Templates.
  3. Choose the template with the technology stack you want to use, and select the one of the projects, for example the Data Model project.
  4. Locate Web Services in the list of A vailable Technologies, and move it to the list of Selected Technologies.
  5. When you click OK, you are returned to the Create Application Workspace dialog, and the template you edited is that selected in the Application Template field.

To add the web service technology to a project:

  1. In the Application Navigator, select the appropriate project.
  2. From the main menu, choose Tools | Project Properties, or right-click and choose Proj ect Properties.
  3. Expand the Common node and select Technology Scope. Locate Web Services in the list of Available Technologies, and move it to the list of Selected Technologies.

Running the Web Service in the Embedded Server

If you are using a J2EE web service that you have created in JDeveloper, by default the web service is created using a connection to an external instance of OC4J as the endpoint. This uses a port number of 8888 . If you deploy your web service to the external OC4J instance before testing your Oracle ADF application, you don't need to do anything further.

However if you want to test your ADF application without deploying the web service externally, you need to use a port number of 8988 in the endpoint URL of the generated stub. 8988 is the port number of JDeveloper's embedded OC4J server.

To change the endpoint URL port number:

  1. Edit the web service.
  2. On the Endpoint page of the Edit Java Web Service dialog, change the port number of the Web Service Endpoint from 8888 to 8988.
  3. Press OK to re-generate the web service. Now generate data controls for the web service. If you have already generated data controls for this web service, you need to generate them again to ensure that the correct endpoint URL is created based on the service endpoint in the WSDL document.

Creating Business Services for the Model Project
About the Oracle ADF Data Controls for Web Services
Creating Oracle ADF Data Controls for Web Services

Using Web Services in Applications

 

Copyright © 1997, 2004, Oracle. All rights reserved.