How to Use Java Code Wrapped in a Service Interface

Not all applications expose a service interface. You may have a scenario in which a business process must use custom Java code. For this scenario, you can:

  • Write custom Java code.

  • Create a service interface in which to embed the code.

  • Invoke the Java code as a web service over SOAP.

For example, assume you create a BPEL process service component in a SOA composite application that invokes a service interface through a SOAP reference binding component. For this example, the service interface used is an Oracle Application Development Framework (ADF) Business Component.

The high-level instructions for this scenario are as follows.

To use Java code wrapped in a service interface:

  1. Create an Oracle ADF Business Component service in Oracle JDeveloper.

    This action generates a WSDL file and XSD file for the service.

  2. Create a SOA composite application that includes a BPEL process service component. Ensure that the BPEL process service component is exposed as a composite service. This automatically connects the BPEL process to an inbound SOAP service binding component.

  3. Import the Oracle ADF Business Component service WSDL into the SOA composite application.

  4. Create a web service binding to the Oracle ADF Business Component service interface.

  5. Design a BPEL process in which you perform the following tasks:

    1. Create a partner link for the Oracle ADF Business Component service portType.

    2. Create an assign activity. For this example, this step copies data (for example, a static XML fragment) into a variable that is passed to the Oracle ADF Business Component service.

    3. Create an invoke activity and connect to the partner link you created in Step 55.a.

  6. Connect (wire) the partner link reference to the composite reference binding component. This reference uses a web service binding to enable the Oracle ADF Business Component service to be remotely deployed.

  7. Deploy the SOA composite application.

  8. Invoke the SOA application from the Test Web Service page in Oracle Enterprise Manager Fusion Middleware Control. For more information, see Initiating a Test Instance of a Business Flow in Administering Oracle SOA Suite and Oracle Business Process Management Suite.

For more information on creating Oracle ADF Business Components, see Developing Fusion Web Applications with Oracle Application Development Framework.