Creating a JAX-WS Web Service in JDeveloper

Note: This section is applicable for JDeveloper 12c and JDeveloper 11g.

After you create and successfully compile a published business service, you can use JDeveloper to create a JAX-WS web service. You create the published business service manager and value object Java files using existing business service development methodology.

Before you run the JDeveloper JAX-WS Web Service wizard to create a web service from a published business service, you move the JAX-WS Web Services library to the top of the Libraries and Classpath properties page so that JDeveloper builds the published business service using the desired web-service standard.

Note: The steps to create a JAX-WS web service also apply to creating a Media Object web service, except that you need to select the Enable MTOM check box in the Message Format page. See the steps in “To create a JAX-WS-based web service from a published business service" for details.

To select JAX-WS as the standard for a published business service:

  1. In JDeveloper, right-click the appropriate published business service project and select Project Properties.

    The Project Properties window for the selected published business service appears.

  2. In the left-hand side tree structure, select Libraries and Classpath.

    The Libraries and Classpath page appears on the right-hand side of the window.

  3. In the Classpath Entries area, select JAX-WS Web Services.

  4. Move the JAX-WS Web Services entry to the top of the page by clicking the Move Up button.

    Clicking the Move Up button moves the entry one level at a time; you may need to click the Move Up button multiple times to move the JAX-WS Web Services entry to the top of the page.

  5. Click OK.

  6. On JDeveloper, save the changes that you made to the Libraries and Classpath property of the selected published business service.

To create a JAX-WS-based web service from a published business service:

  1. In JDeveloper, expand the appropriate published business service project folder.

  2. Right-click on the published business service Manager Java file and select Create Web Service.

    The Create Java Web Service window appears with the Generation Options page available.

  3. On Generation Options, verify the system entered values for the Web Service Name and the Port Name fields.

  4. Click Next to open the Message Format page.

  5. On Message format, do the following:

    • Select SOAP 1.1 Binding option.

    • Select Document/.Literal from the SOAP Message Format drop-down list.

    • Note: If you are creating a Media Object published business service, select the Enable MTOM check box. For more information about Media Object published business services, see Understanding MTOM-Based Media Object Web Services in this guide.
    • Click Next to open the Methods page.

  6. On Methods, verify that all of the public methods that are defined for the published business service Manager Java file are listed and selected.

  7. Click Next to open the Additional Classes page.

  8. On Additional Classes, click Next to open the Configure Policies page.

  9. On Configure Policies, select the No Policies option.

  10. Click Next to open the Provide Handler Details page

  11. On Provide Handler Details, verify the system entered Port and click Next to open the Finish page.

  12. On Finish, click the Finish button to create the web service.

When JDeveloper successfully generates the JAX-WS web service, it also creates a web.xml file in the public_html/web-inf folder of the published business service project. JDeveloper also adds the following annotations to the beginning of the Java class in the PBSSV_Manager.java file.

  • @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)

  • @WebService

If you plan to create a JAX-WS based client for this JAX-WS web service and you want the same client to work with both the EnterpriseOne JAX-WS web service running locally on the JDeveloper Integrated WebLogic server and on a standalone WebLogic Server or WebSphere Application Server or both, replace the above annotations that JDeveloper inserted at the beginning of the PBSSV_Manager Java Class with the following annotations:

  • @SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL, parameterStyle=SOAPBinding.ParameterStyle.BARE)

  • @WebService(serviceName="RI_AddressBookManagerService", portName="RI_AddressBookManagerPort", targetNamespace="http://oracle.e1.bssv.JPR01000/")

Note: The attributes in the @WebService annotation are specific for the RI_AddressBookManager published business service in the JPR01000 business service project. Change the attributes to reference the published business service that you specified for creating the JAX-WS web service.

Manual replacement of the annotations is required to set the targetNamespace attribute in the @WebService annotation with the proper package structure for the published business service project. If the replacement annotations are not specified, JDeveloper uses the reverse package structure; for example, JPR01000.bssv.e1.oracle, and in this scenario the client created for the local web service will not work with the server web service. If the above replacement annotations are made in the PBSSV_Manager Java Class, then they will be similar to the annotations added to the PBSSV_Manager Java Class during the business service package build process. A business service client created for a published business service running locally on either the JDeveloper 11g or JDeveloper 12c integrated WebLogic server also works with a published business service running on a standalone WebLogic server.