Using Business Service Objects

Overview

A business service object, formerly known as Service Bean, is a high-level service component that allows OA Framework or BC4J (Business Components for Java) components to be deployed as web services. This type of interfaces provides access to SOA services and facilitates integration between Oracle E-Business Suite and trading partners.

Business service object interfaces can be exposed as SOAP-based and REST-based services. To better understand how to utilize business service objects, this chapter takes a SOAP service as an example to explain the service invocation. An integration administrator or an integration developer can first generate a SOAP service, and then the administrator can deploy it to an Oracle SOA Suite WebLogic managed server. By leveraging Oracle SOA Suite components, the deployed SOAP service can be orchestrated into a meaningful BPEL process as a SOA composite application with service endpoints. This process can take the data from a business partner and then insert or update Oracle E-Business Suite if necessary.

At runtime, the SOA composite application in the Oracle WebLogic managed server where the soa-infra application is running can be exposed to customers and invoked through any of the web service clients or orchestration tools including Oracle JDeveloper, Apache Axis, .NET Web Service Client, Oracle BPEL Process Manager, and Oracle Enterprise Service Bus (ESB).

To better understand how each individual web service can be used in inserting or updating application data, this chapter provides detailed design-time and runtime tasks to guide you through the service invocation process. For the example described in the following sections, Oracle JDeveloper 11g (11.1.1.6.0) is used as a design-time tool to create the BPEL process and Oracle SOA Suite 11g (11.1.1.6.0) is used for the process deployment.

Note: While using Oracle JDeveloper with other Oracle Fusion Middleware components (such as Oracle SOA Suite), to enable SOA technologies, you need to manually download Oracle SOA Suite Composite Editor, an Oracle JDeveloper extension for SOA technologies. For more information on installing additional Oracle Fusion Middleware design-time components, see the Oracle Fusion Middleware Installation Guide for Oracle JDeveloper.

This chapter includes the following topics:

Using Business Service Object SOAP Services

SOA Composite Application with BPEL Process Scenario

This example uses Purchase Order Service (/oracle/apps/fnd/framework/toolbox/tutorial/PurchaseOrderService) business service object interface to explain the BPEL process creation.

When a purchase order approval request is received, the information of purchase order details is read by a File Adapter. The order data is then passed to the approvePurchaseOrder method within the Purchase Order Service to initiate the single PO approval process. The approval information is then replied back to the requestor.

When the BPEL process has been successfully invoked after the deployment, the purchase order status is changed from Incomplete to Approved.

Prerequisites to Create a SOA Composite Application with BPEL Process Using a Business Service Object Web Service

Deploying a Business Service Object Web Service Composite

An integration administrator or an integration developer must first create a SOAP service for a selected interface definition, and then the administrator can deploy the generated SOAP service from Oracle Integration Repository to an Oracle SOA Suite WebLogic managed server.

For example, the following steps must be performed first before the integration developer can create a BPEL process using the deployed WSDL:

  1. To generate a SOAP service, the integration administrator or the integration developer locates the business service object interface definition first from the Oracle Integration Repository (such as Purchase Order Service /oracle/apps/fnd/framework/toolbox/tutorial/PurchaseOrderService). In the SOAP Web Service tab of the interface details page, select synchronous interaction pattern for the interface or desired methods from the Interaction Pattern table. Click Generate to generate the service.

    Once the service has been successfully generated, the Web Service Status field changed from 'Not Generated' to 'Generated'.

    For detailed instructions on how to generate a SOAP service, see Generating SOAP Web Services, Oracle E-Business Suite Integrated SOA Gateway Implementation Guide.

  2. To deploy a generated SOAP service, the administrator selects one authentication type before clicking Deploy. The deployed service in Oracle SOA Suite is an active service and is ready to accept new SOAP requests.

    Once the service has been successfully deployed, the selected authentication type will be displayed along with 'Deployed' with 'Active' state in the Web Service Status field. For more information on securing web services with the authentication type, see Managing Web Service Security, Oracle E-Business Suite Integrated SOA Gateway Implementation Guide.

    For information on how to deploy a SOAP service, see Deploying and Undeploying SOAP Web Services, Oracle E-Business Suite Integrated SOA Gateway Implementation Guide.

Searching and Recording a WSDL URL

Apart from the required tasks performed by the administrator, the integration developer needs to locate and record the deployed web service WSDL URL for the interface that needs to be orchestrated into a meaningful BPEL process in Oracle JDeveloper.

This WSDL information will be used later in creating a partner link for the interface exposed as a web service during the BPEL process creation at design time.

Interface Details Page with Deployed WSDL Information

the picture is described in the document text

For information on how to search for an interface and review the interface details, see Searching and Viewing Integration Interfaces.

Setting Header Variables for a SOAP Request

Certain variables in the BPEL process for header elements must be populated to pass values that may be required to set application context during the service invocation. These header elements for Business Service Object interface type are RESPONSIBILITY_NAME, RESPONSIBILITY_APPL_NAME, SECURITY_GROUP_NAME, NLS_LANGUAGE, and ORG_ID.

Note: The user name and password information is defined by the web service security policy (such as oracle/wss_username_token_service_policy). For detailed instructions on how to pass the security headers, along with the SOAP request, see Configuring Web Service Policies.

The expected values for these elements are described in the following table:

Header Variables and Expected Values for Business Service Object Interfaces
Element Name Expected Value
RESPONSIBILITY_NAME responsibility_name (such as "System Administrator") or {key}responsibility_key (such as "{key}SYSTEM_ADMINISTRATOR")
RESPONSIBILITY_APPL_NAME Application Short Name (such as "FND")
SECURITY_GROUP_NAME Security Group Key (such as "STANDARD")
NLS_LANGUAGE NLS Language (such as "AMERICAN")
ORG_ID Org ID (such as "202")

Note: NLS_Language and ORG_ID are optional values to be passed.

The context information can be specified by configuring an Assign activity before the Invoke activity in the BPEL PM.

For information on how to set the header variables for the SOAP request, see Assigning ServiceBean_Header Parameters.

Using Business Service Object WSDLs at Design Time

Based on the Purchase Order Service scenario described earlier, this section includes the following design-time tasks:

  1. Create a SOA Composite Application with BPEL Process

    Use this step to create a new SOA Composite application with BPEL project called ApprovePO.bpel. This automatically creates two dummy activities - Receive and Reply - to receive input from a third party application and to reply output of the BPEL process to the request application.

  2. Create a Partner Link

    Use this step to create a partner link for the PurchaseOrderService web service.

  3. Add a Partner Link for File Adapter

    This is to synchronously read purchase order details received from the requestor.

  4. Add Invoke Activities

    Use this step to create two Invoke activities in order to:

    1. Point to the File Adapter - Synchronous Read operation to read the purchase order from the input file.

    2. Point to the PurchaseOrderService web service to initiate the single purchase order approval process.

  5. Add Assign Activities

    Use this step to create three Assign activities in order to:

    1. Set the SOAHeader details.

    2. Pass the purchase order details read from the File Adapter as an input to the Invoke activity for the PurchaseOrderService web service.

    3. Pass single purchase order approval information to the requestor through the Reply activity.

For general information and how to create SOA composite applications using the BPEL process service component, see the Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite for details.

Creating a SOA Composite Application with BPEL Process

Use this step to create a SOA composite application that will contain various BPEL process activities.

To create a new SOA Composite application with BPEL project:

  1. Open Oracle JDeveloper BPEL Designer.

  2. Click New Application in the Application Navigator.

    The "Create SOA Application - Name your application" page is displayed.

  3. Enter an appropriate name for the application in the Application Name field and select SOA Application from the Application Template list.

    Click Next. The "Create SOA Application - Name your project" page is displayed.

  4. Enter an appropriate name for the project in the Project Name field, for example ApprovePO.

  5. In the Project Technologies tab, select 'Web Services' and ensure that SOA is selected from the Available technology list to the Selected technology list.

    Click Next. The "Create SOA Application - Configure SOA settings" page is displayed.

  6. Select Composite With BPEL Process from the Composite Template list, and then click Finish. You have created a new application, and a SOA project. This automatically creates a SOA composite.

    The Create BPEL Process page is displayed.

  7. Leave the default BPEL 1.1 Specification selection unchanged. This creates a BPEL project that supports the BPEL 1.1 specification.

    Enter an appropriate name (such as ApprovePO) for the BPEL process in the Name field.

    Select Synchronous BPEL Process in the Template field.

    Select required from the Transaction drop-down list. Click OK.

    A synchronous BPEL process is created with the Receive and Reply activities. The required source files including bpel and wsdl, using the name you specified (for example, ApprovePO.bpel and ApprovePO.wsdl) and composite.xml are also generated.

  8. Navigate to SOA Content > Business Rules and double click composite.xml to view the composite diagram.

    Double click on the ApprovePO component to open the BPEL process.

Creating a Partner Link

Use this step to configure a Partner Link called PurchaseOrderService.

To create a partner link for PurchaseOrderService:

  1. In Oracle JDeveloper, place your mouse in the Partner Links area and right click to select Create Partner Link... from the pull-down menu. Alternatively, you can drag and drop Partner Link from the BPEL Constructs list into the right Partner Link swim lane of the process diagram.

    The Create Partner Link window appears.

  2. Copy the WSDL URL corresponding to the PurchaseOrderService /oracle/apps/fnd/framework/toolbox/tutorial/PurchaseOrderService that you recorded earlier from the Integration Repository, and paste it in the WSDL File field. Press the [Tab] key.

  3. A Partner Link Type message dialog box appears asking whether you want the system to create a new WSDL file that will by default create partner link types for you.

    Click Yes to have the Partner Name value populated automatically.

    Select the Partner Link Type and Partner Role fields from the drop-down lists. Click Apply.

  4. Click OK to complete the partner link configuration. The partner link is created with the required WSDL settings, and is represented in the BPEL project by a new icon in the border area of the process diagram.

Adding a Partner Link for File Adapter

Use this step to synchronously read the purchase order details received from the third party application.

To add a Partner Link for File Adapter:

  1. In Oracle JDeveloper, drag and drop the File Adapter service from the BPEL Services list into the right Partner Link swim lane of the process diagram. The Adapter Configuration wizard welcome page appears.

  2. Click Next. The Service Name dialog box appears.

  3. Enter a name for the file adapter service for example ReadPO.

  4. Click Next. The Adapter Interface dialog box appears.

  5. Select the Define from operation and schema (specified later) radio button and click Next. The Operation dialog box appears.

  6. Specify the operation type, for example Synchronous Read File. This automatically populates the Operation Name field.

    Click Next to access the File Directories dialog box.

    File Directories Dialog

    the picture is described in the document text

  7. Select the Physical Path radio button and enter the input payload file directory information. For example, enter /usr/tmp/ as the directory name.

    Click Next to open the File Name dialog box.

  8. Enter the name of the file for the synchronous read file operation. For example, enter 'Input.xml'. Click Next. The Messages dialog box appears.

    Messages Dialog

    the picture is described in the document text

  9. Select Browse for schema file in front of the URL field. The Type Chooser window is displayed.

    1. Click the Import Schema Files button on the top right corner of the Type Chooser window.

    2. Enter the schema location for the service, such as http://<soa_suite_hostname>:<port>/soa-infra/services/default/<jndi_name>_PurchaseOrderService/PurchaseOrderService_Service/?XSD=xsd/PurchaseOrderService.xsd.

      Schema location for your service can be found from the service WSDL URL (for example, http://<soa_suite_hostname>:<port>/soa-infra/services/default/<jndi_name>_PurchaseOrderService/PurchaseOrderService_Service?wsdl).

      Import Schema File Dialog

      the picture is described in the document text

    3. Select the Copy to Project checkbox and click OK.

    4. The Localize Files window appears. Ensure the Maintain original directory structure for imported files checkbox is selected and click OK.

      The Imported Schema folder is automatically added to the Type Chooser window.

    5. Expand the Imported Schema folder and select PurchaseOrderService_ApprovePurchaseOrder from the PurchaseOrderService.xsd. Click OK.

      The selected .xsd is displayed as URL, and the PurchaseOrderService_ApprovePurchaseOrder is selected as Schema Element.

      Messages Dialog with Selected Message Schema

      the picture is described in the document text

  10. Click Next and then Finish. The wizard generates the WSDL file corresponding to the partner link. The main Create Partner Link dialog box appears, specifying the new WSDL file ReadPO.wsdl.

    Click Apply and then OK to complete the configuration and create the partner link with the required WSDL settings for the File Adapter service.

    The ReadPO Partner Link appears in the BPEL process diagram.

  11. Under applications window, navigate to file ReadPO_file.jca. Set value of property "DeleteFile" to "false".

Adding an Invoke activity

This step is to configure two Invoke activities to:

  1. Point to the File Adapter ReadPO to synchronously read the purchase order from the Receive activity.

  2. Point to the PurchaseOrderService partner link to send the transaction information that is received from the Assign activities to initiate the single purchase order approval process.

To add an Invoke activity for ReadPO Partner Link:

  1. In Oracle JDeveloper, expand the BPEL Constructs from the Component Palette. Drag and drop the Invoke activity into the center swim lane of the process diagram, between the receiveInput and replyOutput activities.

  2. Link the Invoke activity to the ReadPO service. The Edit Invoke dialog box appears.

  3. Enter a name for the Invoke activity, such as 'InvokeReadPO', and then click the Create icon next to the Input Variable field to create a new variable. The Create Variable dialog box appears.

    Enter an appropriate name in the Name field. You can also accept the default name.

    Create Variable Dialog

    the picture is described in the document text

  4. Select Global Variable and click OK.

  5. Click the Create icon next to the Output Variable field to create a new variable. The Create Variable dialog box appears.

    Enter an appropriate name in the Name field. You can also accept the default name.

    Select Global Variable. Click OK.

  6. Click Apply and then OK in the Edit Invoke dialog box to finish configuring the Invoke activity.

    The Invoke activity appears in the process diagram.

    BPEL Process Diagram with the First Invoke Activity Added

    the picture is described in the document text

To add an Invoke activity for PurchaseOrderService Partner Link:

  1. In Oracle JDeveloper, expand the BPEL Constructs from the Component Palette. Drag and drop the Invoke activity into the center swim lane of the process diagram, after the first Invoke activity and the reployOutput activity.

  2. Link the Invoke activity to the PurchaseOrderService service. The Edit Invoke dialog box appears.

  3. Enter a name for the second Invoke activity such as 'InvokePOService'. Create input and output variables described in the first Invoke activity. Click OK to close the Create Variable dialog box.

  4. Click Apply and then OK to finish configuring the second Invoke activity.

    The second Invoke activity appears in the process diagram.

    BPEL Process Diagram with the Second Invoke Activity Added

    the picture is described in the document text

Adding an Assign activity

This step is to configure three Assign activities to:

  1. Set the header details.

    Note: You need to populate certain variables in the BPEL process for ServiceBean_Header elements to pass values that may be required to embed application context into SOAP envelopes for web service authorization. These ServiceBean_Header elements for Business Service Object interface type are RESPONSIBILITY_NAME, RESPONSIBILITY_APPL_NAME, SECURITY_GROUP_NAME, NLS_LANGUAGE, and ORG_ID.

    Detailed information on how to set ServiceBean_Header for the SOAP request, see Assigning ServiceBean_Header Parameters.

  2. Pass the purchase order details read from the File Adapter as an input to the second Invoke activity for PurchaseOrderService partner link.

  3. Pass single purchase order approval information to the requestor through the dummy Reply activity.

To add the first Assign activity to pass header details:

Assigning ServiceBean_Header Parameters:

  1. In Oracle JDeveloper, expand the BPEL Constructs from the Component Palette. Drag and drop the Assign activity into the center swim lane of the process diagram between the two Invoke activities you just created earlier.

  2. Double-click the Assign activity to access the Edit Assign dialog box.

  3. Click the General tab to enter the name for the Assign activity, such as 'SetServiceBeanHeader'.

  4. Select the Copy Rules tab and expand the target trees:

    • Click the Expression icon to invoke the Expression Builder dialog.

      Enter 'Purchasing, Vision Operations (USA)' in the Expression box. Click OK. The Expression icon with the expression value appears in the center of the Edit Assign dialog, between the From and To navigation tree nodes.

    • In the To navigation tree, navigate to Variables > Process > Variables > InvokePurchaseOrderService_PurchaseOrderService_ApprovePurchaseOrder_InputVariable > header> ns5:ServiceBean_Header and select ns5:RESPONSIBILITY_NAME.

    Drag the Expression icon to connect to the target node (ns5:RESPONSIBILITY_NAME) that you just identified. This creates a line that connects the source and target nodes. The copy rule is displayed in the From and To sections at the bottom of the Edit Assign dialog box.

    Edit Assign Dialog for the First Assign Activity

    the picture is described in the document text

  5. Enter second pair of parameters by clicking the Expression icon to invoke the Expression Builder dialog.

    • Enter 'PUR' in the Expression box. Click OK. The Expression icon with the expression value ('PUR') appears in the center of the Edit Assign dialog, between the From and To navigation tree nodes.

    • In the To navigation tree, navigate to Variables > Process > Variables > InvokePurchaseOrderService_PurchaseOrderService_ApprovePurchaseOrder_InputVariable > header> ns5:ServiceBean_Header and select ns5:RESPONSIBILITY_APPL_NAME.

    Drag the Expression icon to connect to the target node (ns5:RESPONSIBILITY_APPL_NAME) that you just identified. This creates a line that connects the source and target nodes. The copy rule is displayed in the From and To sections at the bottom of the Edit Assign dialog box.

  6. Enter third pair of parameters by clicking the Expression icon to invoke the Expression Builder dialog.

    • Enter 'STANDARD' in the Expression box. Click OK. The Expression icon with the expression value ('STANDARD') appears in the center of the Edit Assign dialog, between the From and To navigation tree nodes.

    • In the To navigation tree, navigate to Variables > Process > Variables > InvokePurchaseOrderService_PurchaseOrderService_ApprovePurchaseOrder_InputVariable > header> ns5:ServiceBean_Header and select ns5:SECURITY_GROUP_NAME.

    Drag the Expression icon to connect to the target node (ns5:SECURITY_GROUP_NAME) that you just identified. This creates a line that connects the source and target nodes. The copy rule is displayed in the From and To sections at the bottom of the Edit Assign dialog box.

  7. Enter the fourth pair of parameters by clicking the Expression icon to invoke the Expression Builder dialog.

    • Enter 'AMERICAN' in the Expression box. Click OK. The Expression icon with the expression value ('AMERICAN') appears in the center of the Edit Assign dialog, between the From and To navigation tree nodes.

    • In the To navigation tree, navigate to Variables > Process > Variables > InvokePurchaseOrderService_PurchaseOrderService_ApprovePurchaseOrder_InputVariable > header> ns5:ServiceBean_Header and select ns5:NLS_LANGUAGE.

    Drag the Expression icon to connect to the target node (ns5:NLS_LANGUAGE) that you just identified. This creates a line that connects the source and target nodes. The copy rule is displayed in the From and To sections at the bottom of the Edit Assign dialog box.

  8. Enter the fifth pair of parameters by clicking the Expression icon to invoke the Expression Builder dialog.

    • Enter '204' in the Expression box. Click OK. The Expression icon with the expression value ('204') appears in the center of the Edit Assign dialog, between the From and To navigation tree nodes.

    • In the To navigation tree, navigate to Variables > Process > Variables > InvokePurchaseOrderService_PurchaseOrderService_ApprovePurchaseOrder_InputVariable > header> ns5:ServiceBean_Header and select ns5:ORG_ID.

    Drag the Expression icon to connect to the target node (ns5:ORG_ID) that you just identified. This creates a line that connects the source and target nodes. The copy rule is displayed in the From and To sections at the bottom of the Edit Assign dialog box.

    Edit Assign Dialog with All ServiceBean_Header Parameters

    the picture is described in the document text

  9. Click Apply and then OK to complete the configuration of the Assign activity.

To enter the second Assign activity to pass PO details to the InvokePOService Invoke activity:

  1. In Oracle JDeveloper BPEL Designer, drag and drop the second Assign activity from the BPEL Constructs into the center swim lane of the process diagram, between the first Assign and Invoke activities.

  2. Double-click the Assign activity to access the Edit Assign dialog box.

  3. Click the General tab to enter the name for the Assign activity, such as 'SetPOApproval'.

  4. Select the Copy Rules tab and expand the target trees:

    • In the From navigation tree, navigate to Variables > Process > Variables > InvokeReadPO_SynchRead_OutputVariable > PurchaseOrderService_ApprovePurchaseOrder > body > ns6:PurchaseOrderService_ApprovePurchaseOrder and select poNumber.

    • In the To navigation tree, navigate to Variables > Process > Variables > InvokePurchaseOrderService_PurchaseOrderService_ApprovePurchaseOrder_InputVariable > body > ns6:PurchaseOrderService_ApprovePurchaseOrder and select poNumber.

    Drag the source node (poNumber) to connect to the target node (poNumber) that you just identified. This creates a line that connects the source and target nodes. The copy rule is displayed in the From and To sections at the bottom of the Edit Assign dialog box.

    Edit Assign Dialog for the Second Assign Activity

    the picture is described in the document text

  5. Click Apply and then OK to complete the configuration of the Assign activity.

To enter the third Assign activity to set the SOAP response to output:

  1. Add the third Assign activity by dragging and dropping the Assign activity into the center swim lane of the process diagram, between the InvokePOService Invoke and the Replyoutput activities.

  2. Repeat Step 2 to Step 3 described in creating the first Assign activity to add the second Assign activity called 'SetPOStatus'.

  3. Select the Copy Rules tab and expand the source and target trees:

    • In the From navigation tree, navigate to Variables > Process > Variables > InvokePurchaseOrderService_PurchaseOrderService_ApprovePurchaseOrder_OutputVariable and select body.

    • In the To navigation tree, navigate to Variables > Process > Variables > outputVariable and select payload.

    Drag the source node (body) to connect to the target node (payload) that you just identified. This creates a line that connects the source and target nodes. The copy rule is displayed in the From and To sections at the bottom of the Edit Assign dialog box.

    Edit Assign Dialog for the Third Assign Activity

    the picture is described in the document text

  4. Click Apply and then OK to complete the configuration of the Assign activity.

Configuring Web Service Policies

Use the following steps to add a security policy at design time:

  1. Navigate to SOA Content > Business Rules > composite.xml. Right click on the PurchaseOrderService service and select "Configure WS Policies" from the drop-down list.

  2. The Configure SOA WS Policies dialog appears.

    In the Security section, click the Add icon (+). The Select Server Security Policies dialog appears.

    Select 'oracle/wss_username_token_service_policy' and click OK.

    The attached security policy is shown in the Security section.

  3. From the navigation menu, select View > Property Inspector to display the Property Inspector window for PurchaseOrderService service component.

    In the Properties section, click the Add icon (+) for binding properties. The Create Property dialog appears.

    Enter 'oracle.webservices.auth.username' in the Name field and enter 'operations' as the value.

    Click OK.

  4. Use the same approach by clicking the Add icon (+) again in the Properties section for binding properties. Enter 'oracle.webservices.auth.password' in the Name field. Enter the associated password for user 'operations' in the Value field.

    Click OK.

    Both selected property names and values appear in the Properties section.

Deploying and Testing the SOA Composite with BPEL Process at Runtime

To invoke the synchronous PurchaseOrderService from the BPEL client contained in the SOA composite, the SOA composite needs to be deployed to the Oracle WebLogic managed server. This can be achieved using Oracle JDeveloper. Once the composite is deployed, it can be tested from the Oracle Enterprise Manager Fusion Middleware Control Console.

Prerequisites

Before deploying the SOA composite with BPEL process using Oracle JDeveloper, you must have established the connectivity between the design-time environment and the runtime server. For information on how to configure the necessary server connection, see Configuring Server Connection.

Note: If a local instance of the Oracle WebLogic Server is used, start the WebLogic Server by selecting Run > Start Server Instance from Oracle JDeveloper. Once the WebLogic Admin Server "DefaultServer" instance is successfully started, the <Server started in Running mode> and DefaultServer started message in the Running:DefaultServer and Messages logs should appear.

Perform the following runtime tasks:

  1. Deploy the SOA Composite Application with BPEL Process

  2. Test the SOA Composite Application with BPEL Process

Deploying the SOA Composite with BPEL Process

You must deploy the Approve Purchase Order SOA composite (POApprove.bpel) that you created earlier before you can run it.

To deploy the SOA composite application:

  1. In the Applications Navigator of JDeveloper, select the POApprove project.

  2. Right-click the project and select Deploy > [project name] > [serverConnection] from the menu.

    For example, you can select Deploy > POApprove > SOAServer to deploy the process if you have the connection appropriately.

    Note: If this is the first time to set up the server connection, then the Deployment Action dialog appears. Select 'Deploy to Application Server' and click Next.

    In the Deploy Configuration dialog, ensure the following information is selected before clicking Next to add a new application server:

    • New Revision ID: 1.0

    • Mark composite revision as default: Select this checkbox.

    • Overwrite any existing composites with the same revision ID: Select this checkbox.

    The steps to create a new Oracle WebLogic Server connection from Oracle JDeveloper are covered in Configuring Server Connection.

  3. In the Select Server dialog, select 'soa-server1' that you have established the server connection earlier. Click Next.

  4. In the SOA Servers dialog, accept the default target SOA Server ('soa-server1') selection.

    Click Next and Finish.

  5. If you are deploying the composite for the first time from your Oracle JDeveloper session, the Authorization Request window appears. Enter the user name and corresponding password specified during the Oracle SOA Suite installation. Click OK.

  6. Deployment processing starts. Monitor deployment process and check for successful compilation in the SOA - Log window.

    Verify that the deployment is successful in the Deployment - Log window.

Testing the SOA Composite Application with BPEL Process

Once the BPEL process contained in the SOA composite has been deployed, you can manage and monitor the process from Oracle Enterprise Manager Fusion Middleware Control Console.

For more information about Oracle SOA Suite, see the Oracle Fusion Middleware Administrator's Guide for Oracle SOA Suite.

To test the SOA composite application with BPEL process:

  1. Navigate to Oracle Enterprise Manager Fusion Middleware Control Console (http://<hostname>:<port>/em). The login page appears.

  2. Enter the user name and corresponding password specified during the installation, and then click Login to log in to a farm. The composite (ApprovePO) you deployed is displayed in the Applications Navigation tree.

    You may need to select an appropriate target instance farm if there are multiple target Oracle Enterprise Manager Fusion Middleware Control Console farms.

  3. From the Farm navigation pane, expand the SOA >soa-infra node in the tree to navigate through the SOA Infrastructure home page and menu to access your deployed SOA composite applications running on soa-infra managed server.

    Click the ApprovePO [1.0] link.

  4. Click the Policies tab and notice that the 'oracle/wss_username_token_service_policy' policy you attached to the PurchaseOrderService service binding earlier at the design time is now displayed here.

  5. In the ApprovePO [1.0] home page, click Test.

  6. The Test Web Service page for initiating an instance appears. You can specify information as XML payload data to use in the Input Arguments section.

    Note: If the WS-Security credentials are not entered at design time, you can enter the credentials at runtime by selecting the WSS Username Token option in the Security section at the top of the Request tab. Enter 'operations' in the Username field and the associated password for user 'operations'.

    Click Test Web Service to initiate the process.

    The test results appear in the Response tab upon completion.

  7. Click your BPEL service component instance link (such as ApprovePO) to display the Instances page where you can view the invocation details of the BPEL activities in the Audit Trail tab.

    Click the Flow tab to check the BPEL process flow diagram. Click an activity of the process diagram to view the activity details and flow of the payload through the process.

  8. This is to verify that a purchase order is approved successfully.

Validating the Process in Oracle E-Business Suite

Additionally, you can validate the BPEL process in Oracle E-Business Suite. Log in to Oracle E-Business Suite as a user who has the Purchasing responsibility. Open the Purchase Orders form and search for the supplier to bring up the purchase order details. You will notice that the Status field is 'Approved'.

Using Business Service Object REST Services

REST Service Invocation Scenario

To explain how to use a Business Service Object REST service, this scenario takes an interface "Location Business Object Services" (oracle.apps.ar.hz.service.party.LocationService) as an example to guide you through the Business Service Object REST service invocation.

At runtime when a request of providing location business object details is received, the getLocation service operation contained in the "Location Business Object Services" interface is invoked to fetch the location details of that particular location business object from TCA.

After a successful service invocation, the REST response message that contains the specific location business object details is sent back to the requestor.

Invoking a Business Service Object REST Service

Based on the REST service invocation scenario described here, this chapter includes the following topics:

  1. Deploying a Business Service Object REST Service

  2. Creating a Security Grant for the Deployed Service

  3. Recording Resource Information from Deployed WADL

  4. Invoking a REST Service Using Command Lines

Deploying a Business Service Object REST Service

Use the following steps to deploy the Business Service Object "Location Business Object Services" (oracle.apps.ar.hz.service.party.LocationService) as a REST service:

  1. Log in to Oracle E-Business Suite as a user who has the Integration Administrator role.

    Select the Integrated SOA Gateway responsibility and the Integration Repository link from the navigation menu.

  2. In the Integration Repository tab, click Search to access the main Search page.

  3. Enter the following key search values as the search criteria:

    • Internal Name: Location Business Object Services

    • Interface Type: Business Service Object

  4. Click Go to run the search.

    Click the "Location Business Object Services" interface name link to open the interface details page.

  5. In the REST Web Service tab, enter the following information:

    • Service Alias: location

      The alias will be displayed as the service endpoint in the WADL and schema for the selected method or operation.

    • Select Desired Service Operations

      In the second row getLocation, select both the GET and POST HTTP method checkboxes.

    • In the REST Service Security region, ensure that at least one authentication type is selected.

  6. Click Deploy to deploy the service to an Oracle E-Business Suite WebLogic environment.

Once the REST service has been successfully deployed, 'Deployed' appears in the REST Service Status field along with the View WADL link. Click the View WADL link to view the deployed service WADL description.

Interface Details Page with REST Web Service Tab

the picture is described in the document text

For more information on deploying REST services, see Deploying REST Web Services, Oracle E-Business Suite Integrated SOA Gateway Implementation Guide.

Creating a Security Grant for the Deployed Service

After deploying the "Location Business Object Services" as a REST service, the integration administrator can create a security grant to authorize the service or method access privileges to a specific user, a user group, or all users.

Use the following steps to create a security grant:

  1. Log in to Oracle E-Business Suite as a user who has the Integration Administrator role. Select the Integrated SOA Gateway responsibility and the Integration Repository link from the navigation menu.

  2. Perform a search to locate the "Location Business Object Services" service the administrator just deployed earlier.

  3. In the interface details page of the selected "Location Business Object Services", click the Grants tab.

  4. Select the getLocation method checkbox and then click Create Grant.

  5. In the Create Grants page, select "All User" as the Grantee Type.

    Note: In this example, the getLocation service operation is granted to all users. In actual implementation, you should define strict security rules. Create grant to a user or more appropriately to a group of users defined by roles and responsibilities.

    Click Create Grant. This grants the selected method access privilege to all Oracle E-Business Suite users.

Recording Resource Information from Deployed WADL

To obtain service resource information from the deployed "Location Business Object Services" service, an integration developer clicks the View WADL link in the REST Web Service tab. This displays the WADL description in a different window.

Copy or record the REST service endpoint from the WADL description. This will be used later when invoking the service.

http://<hostname>:<port>/webservices/rest/location/getLocation/

Replace location, the alias in this sample deployment, with the alias name you used in your deployment.

Invoking a REST Service Using Command Lines

In this example, the deployed getLocation service operation with the GET method will be invoked to fetch data.

A third party command line tool called cURL is used to transfer data using URL syntax. This tool is available by default on most Linux environments.

Note: You can test the REST service invocation using any REST client.

Fetching Data Using the HTTP GET Method

When a request of fetching location data is received, the GET method of the getLocation service operation is used to fetch TCA location details for a particular location. The output response with the location details will be sent back to the requestor.

Invoking the REST Service Using Command Line Tool

For example, run the following curl command to fetch locationId values through the getLocation REST service operation.

curl -u <usernmae>:<password> -X GET 
'https://<ebshost>:<port>/webservices/rest/<alias>/getLocation/?locationID=<location id>'

Viewing the Response Message

When the REST service is successfully invoked, it may return the following response:

{
  "tns0:getLocation_Output" : {
    "@xmlns:tns0" : "ht/rest/location/getLocation/",
    "@xmlns:xsi" : "http://www.w3.org/2001/XMLSchema-instance",
    "@xmlns:xsd" : "http://www.w3.org/2001/XMLSchema",
    "@xmlns:tns1" : "http://xmlns.oracle.com/apps/ar/hz/service/party",
    "tns1:OutputParameters" : {
      "location" : {
        "ActionType" : null,
        "LocationId" : "xxx",
        "OrigSystem" : null,
        "OrigSystemReference" : null,
        "Country" : "US",
        "Address1" : "401 Island Parkway",
        "Address2" : null,
        "Address3" : "Example Inc.",
        "Address4" : null,
        "City" : "Redwood Shores",
        "PostalCode" : "94065",
        "State" : "CA",
        "Province" : null,
        "County" : "San Mateo",
        "AddressKey" : null,
        "AddressStyle" : null,
        "ValidatedFlag" : null,
        "AddressLinesPhonetic" : null,
        "PostalPlus4Code" : null,
        "Position" : null,
        "LocationDirections" : null,
        "AddressEffectiveDate" : null,
        "AddressExpirationDate" : null,
        "ClliCode" : null,
        "Language" : null,
        "ShortDescription" : null,
        "Description" : null,
        "LocHierarchyId" : null,
        "SalesTaxGeocode" : null,
        "SalesTaxInsideCityLimits" : null,
        "FaLocationId" : null,
        "TimezoneId" : "1",
        "ProgramUpdateDate" : "2005-05-04T17:49:58.0",
        "CreatedByModule" : null,
        "CreatedByName" : "xxxxx",
        "CreationDate" : "1997-02-21T00:00:00.0",
        "LastUpdateDate" : "2005-05-04T17:49:58.0",
        "LastUpdatedByName" : "xxxxx",
        "ActualContentSource" : "USER_ENTERED",
        "DeliveryPointCode" : null,
        "GeometryStatusCode" : "MULTIMATCH",
        "CommonObjId" : null,
        "Geometry" : null
      }
    }
  }
}