IBM BPM, V8.0.1, All platforms > Migrating and upgrading your IBM BPM environment > Migrating from other products > Migrating from WebSphere Studio Application Developer Integration Edition > Additional migration information > Create SCA Components and SCA Imports for the services in the application for rewiring > Migrating a Java service

Create a Java web service: option 2

If the Migration wizard did not fully migrate all of your service projects, an alternative option to consider using is the Rational Application Developer web services tools that allows you to create a web service around a Java™ class.

See the information at the following site before attempting to migrate using this method: Create a Web service from a Java bean using the IBM WebSphere JAX-WS runtime environment.

This option requires that a web service runtime environment be configured through IBM Integration Designer before invoking the web service wizard.

If you had taken a bottom-up approach in WebSphere Studio Application Developer Integration Edition to generate WSDL around the Java class, follow these steps:

  1. Create a new web project and copy the Java class that you would like to build a service around to this web project's Java source folder.
  2. Right-click the enterprise application project that is the container for the Java class you are creating a service around.

  3. Select Properties, go to the Targeted Runtimes properties, and ensure that the Target runtime is set to IBM Process Server v8.0.

  4. Start the test server. Deploy this application to the server and ensure that it starts successfully.
  5. Next, right-click the Java class that you would like to create a service around and select Web Services > Create Web service.

  6. For Web Service Type, select Bottom up Java bean Web Service. Change the slider from Start service to Assemble service unless you want to deploy the web service right away. You can optionally select to generate a client proxy as well.

  7. The Java class that you right-clicked will be shown as the service implementation.

  8. Configure your service deployment options. For server runtime, it should be IBM Process Server v8.0. Click it if you need to change it. Specify your web service runtime. IBM WebSphere JAX-WS is preferred. For the Service project, ensure that the appropriate web project is selected, along with the appropriate Service EAR project. Click Next.

  9. For the Service project, enter the name of the web project. Also select the appropriate EAR project. Click Next.
  10. Take the defaults, with the exception of ensuring that the Generate WSDL file into the project option is selected. Click Next.

  11. Click Next. On the Web Service package to namespace mapping panel, click Add. In the row that is created, enter the name of the package of the JavaBeans, then add the custom namespace that uniquely identifies this Java class. Continue to add mappings for all Java packages used by the JavaBeans interface.

  12. Click Finish. After completing the wizard, copy the generated WSDL file that describes the Java service to the business integration module project if the service project was a consumer of the Java service. It can be found in the generated router web project under the folder WebContent/WEB-INF/wsdl. Refresh/rebuild the business integration module project.
  13. Switch to the Business Integration perspective and expand the module and then the Web Service Ports logical category.

  14. Select the port that was created in the previous steps and drag it onto the Assembly Editor to create an import with web service binding. Now the SCA component that consumed the Java component in 5.1 can be wired to this Import to complete the manual rewiring migration steps.

The interface might be slightly different from the 5.1 interface, and you might need to insert an Interface Mediation component in between the 5.1 consumer and the new Import. To do this, click the wire tool in the Assembly Editor and wire the SCA source component to this new Import with Web Service Binding. As the interfaces are different, you will be prompted: Source and target nodes do not have matching interfaces. Choose to create an interface mapping between the source and target node. Double-click the mapping component that was created in the Assembly Editor. This will open the mapping editor. See the Information Center for instructions on creating an interface mapping.

If you had taken a top-down approach in WebSphere Studio Application Developer Integration Edition, generating Java classes from a WSDL definition, then follow these steps:

  1. Create a new web project and copy the WSDL file that you would like to Java skeleton to this web project's source folder.
  2. Right-click the WSDL file containing the PortType that you want to generate a Java skeleton from and select Web Services > Generate Java bean skeleton.

  3. Choose the web service typeSkeleton Java bean Web Service and complete the wizard.
After completing the wizard, you should have Java classes that implement the service interface and are not dependent on WSIF APIs.

: Migrating a Java service