3 Service Consumer Reference Implementations

This chapter contains the following topics:

3.1 Testing the Business Services Server as a Web Service Consumer

This section provides an overview, lists prerequisites, and discusses how to:

  • Configure the reference implementations used for testing the Business Services Server.

  • Run the RI AddressBook test program.

3.1.1 Overview

JD Edwards EnterpriseOne provides the RI AddressBook program (P954001), a test program that enables you to verify that the Business Services Server is set up correctly as a web service consumer. To test the configuration, you use P954001 to request address book information for a particular user in JD Edwards EnterpriseOne.

P954001 is not programmed to retrieve address book information directly from the Address Book Master table (F0101); in other words, it is not built on F0101. Instead, to retrieve the address book information, P954001 is programmed to make a call to a web service that is deployed on the Business Services Server. The web service is responsible for retrieving the associated address book data, based on the address book number that was entered in P954001. The web service sends the information back to P954001. If the information for the address book record appears in P954001, then the Business Services Server is set up correctly for consuming web services.

P954001 uses one of the following web service reference implementations to test JD Edwards EnterpriseOne as a web service consumer:

  • JRH90I30 RI_ABWebServiceProcessor

  • JRH90I31 RI_WAS_ABWebServiceProcessor

The reference implementation that is used depends on whether the Business Services Server is deployed on Oracle Application Server or WebSphere Application Server.

Both reference implementations expose the getAddressBook method, which is used by the reference implementations to call a web service. This method calls the third-party web service to look up an address book number. For the purpose of this reference implementation, the third-party web service being called is the JD Edwards EnterpriseOne Addressbook web service.

3.1.2 Prerequisites

Before you perform the tasks in this section, you must:

  • Install these reference implementations:

    • JRH90I30 RI_ABWebServiceProcessor

    • JRH90I31 RI_WAS_ABWebServiceProcessor

3.1.3 Configuring the Reference Implementations Used for Testing the Business Services Server

In addition to the prerequisites, you must perform these tasks before you can use the P954001 test program:

  • Set the business service property value.

    The system uses this property value to determine which reference implementation is used, depending on whether the Business Services Server is deployed on Oracle Application Server or WebSphere Application Server.

  • Create a softcoding record for the reference implementation.

    A softcoding record contains the actual softcoding value that a business service uses to call an external web service.

To set the business service property value:

In the JD Edwards EnterpriseOne web client, enter P951000 in the Fast Path to access the Launch Service Property program.

  1. On Work with Business Service Property, select the All option for Level.

  2. In the Key search field in the grid, enter JRH90I30_APP_SERVER_OAS_OR_WAS and click Find.

  3. Select the Service Property record and then click the Select button.

    Description of image003.png follows
    Description of the illustration image003.png

  4. On Modify Business Service Property, enter OAS or WAS in the Value field, depending on the type of operating system the Development Business Services Server is deployed on.

  5. Select the System option for Level.

  6. Click OK to save the record.

To create a soft coding record for the reference implementation:

Use the soft coding template delivered in JD Edwards EnterpriseOne to create a soft coding record.

In the JD Edwards EnterpriseOne web client, enter P954000 in the Fast Path.

  1. On Work with Web Service Soft Coding Records, click Add.

    Description of image005.png follows
    Description of the illustration image005.png

  2. On Add Web Service Soft Coding Record, complete these fields:

    Field Description
    User / Role Enter a valid user or role.
    Environment Enter an environment.
    Template Name Enter E1_JRH90I30.

  3. Click the Populate Soft Coding Value button.

  4. Locate the <stub-property><value> node in the XML and replace the value from the template with:

    http://servermachinename.domain:port/environment/RI_AddressBookManager

  5. Locate username-token and change the username to a user that has credentials to consume the web service.

  6. In the Mask Fields grid, enter a password for this user in the Mask Value text field.

  7. Click OK to save the record.

3.1.4 Running the RI AddressBook Test Program

In the JD Edwards EnterpriseOne web client, enter P954001 in the Fast Path to access the RI AddressBook program.

Enter 4242 in the Address Number field and then click the getAddressBookInfo button.

The RI AddressBook program calls a business function that calls a business service. The business service consumes the AddressBook web service. The AddressBook web service retrieves the address book record for the address book number that was entered. If the information for the address book record appears in the application form, then the business services server has been configured correctly.

The following example shows a returned address book record in the RI Address Book program:

Description of image007.png follows
Description of the illustration image007.png

3.2 Java Test Client Reference Implementations

You can install, configure, and run reference implementations for Java test clients that call business services through a web service interface. Oracle provides the WASCustomerManagerJavaClient reference implementation to test this functionality on the WebSphere Application Server.

The Java test client reference implementation invokes the JPR01020: RI_CustomerManager business service reference implementation. This reference implementation contains the getCustomerCreditInfo method, which retrieves customer credit information based on input of customer number.

3.2.1 Accessing the Java Test Client Reference Implementations

The files that you need to install the Java test client reference implementations are in a Zip file located in this JD Edwards EnterpriseOne installation directory:

\\EnterpriseOneInstallDirectory\System\Classes\samples\BSSVJavaClient

The Zip file includes a readme file that contains a list of prerequisites and provides instructions on how to install and run the reference implementation.

3.3 HTTP Request Reference Implementations

The HTTP request reference implementations are examples of how business services can enable JD Edwards EnterpriseOne to communicate with a third-party system using HTTP POST. The HTTP request reference implementations include:

  • JRH90I32

    This reference implementation is an example a business service that is used to post XML data to a third-party site.

  • JPRH90I0

    This reference implementation is an example of a published business service that takes the HTTP request from the third party and checks for authentication and authorization of the credentials in the message. JPRH90I0 sends a message to the JD Edwards EnterpriseOne web client instance that is waiting for a response from the third-party site.

The following scenario depicts what would happen if these reference implementations were deployed on the Business Services Server in a JD Edwards EnterpriseOne web service consumer setup:

  1. A JD Edwards EnterpriseOne web client user runs an application that requests information from a third-party site.

  2. The web client invokes a business function that calls the JRH90I32 business service.

  3. JRH90I32 runs and posts XML data to the third-party site.

    The XML data contains callback information that the third-party system can use to send an asynchronous reply to the request.

  4. The Business Service Server waits for the third-party site to send an HTTP message to the Business Service Server.

  5. The third-party site processes the information that was provided in the JRH90I32 RI and sends the Business Service Server an HTTP request.

  6. JPRH90I0 receives the HTTP request from the third party and checks for authentication and authorization of the credentials in the message.

  7. Upon successful authentication and authorization, JPRH90I0 sends a message that contains the requested information from the third-party site to the JD Edwards EnterpriseOne Web client instance.

Note:

You can only use HTTP request reference implementations as examples for creating your own custom business services.

3.4 Downloading and Deploying the JDeveloper 11g Reference Implementation Business Service for WebLogic Server

This section provides an overview of the JDeveloper 11g Business Service reference implementation for the WebLogic Server and discusses how to:

  • Download the reference implementation.

  • Deploy the reference implementation to the WebLogic Server.

3.4.1 Understanding the JDeveloper 11g Reference Implementation for WebLogic Server Configuration

This reference implementation (JRH90I33) is a JDeveloper 11g business service for the WebLogic Server, specifically for the consumer scenario. If you are planning to install JDeveloper 11g and build web services for the WebLogic Server, you can download and install the business service reference implementation from the Update Center on My Oracle Support.

The business service code is built from JDeveloper 11g and should be used only with Tools 8.98 Update 3 release and later. Applying this reference implementation without the corresponding tools release will disable the business service package build on the WebSphere Application Server.

3.4.2 Downloading the Reference Implementation

You download the JDeveloper 11g reference implementation business service for a WebLogic Server from the Update Center on My Oracle Support. From the Update Center, search for one of these configuration files to download to your system:

  • TLRI900001 for the E900 release

  • TLRI812001 for the 812 release

  • TLRI81A001 for the 811 SP1 release

Use Change Assistant to deploy the configuration to your target environment.

3.4.3 Searching for and Downloading the Reference Implementation

You use the JD Edwards EnterpriseOne Change Assistant application, which is available on the Update Center on My Oracle Support, to download the configuration file. The following tasks explain how to search for, download and deploy the configuration file for E900. You use the same steps to download and deploy 812 and 811SP1 configuration files.

To search for and download the reference implementation:

Access JD Edwards EnterpriseOne Change Assistant.

  1. In the navigation area, select the Search for Packages node, and click the Advanced Search tab.

  2. In the Search by Types area, select Configurations from the Types drop-down list.

  3. In the Search by Names area, enter the Configuration File Name (for example, TLRI900001) or part of the filename with a wildcard (*), and then click Search.

    Change Assistant searches for matches across available updates and displays the top 20 matches in a search results grid in the Search area.

  4. Select the check box next to the configuration file (TLRI900001) from the search results.

    Description of image009.gif follows
    Description of the illustration image009.gif

  5. From the Package menu, click Download.

    Change Assistant downloads the selected configuration file to your downloads folder. You also download ESUs from the Update Center to this folder.

To deploy the configuration file:

On the JD Edwards EnterpriseOne Change Assistant.

  1. Select the check box for the configuration file name that you want to deploy.

  2. From the Package menu, click Deploy.

  3. Change Assistant prompts you with the Environment Selection form.

  4. In the Deploying To area of the Environment Selection form, select one or more environments to which you want to deploy the configuration file.

  5. Click OK.

  6. Click Yes or No on the Warning message.

    When you click Yes, the selected configuration is deployed to the selected environments.

Change Assistant displays the Change Assistant Deployment Summary form that indicates that the deployment was a success or failure.

To test that the deployment was successful, check for the presence of the JRH90I33.jar file under <Deployment Server>\E900\DV900\Java\Sbfjars.

Also look in the Object Librarian master table (F9860) where Object Name JRH90I33 should exist.

3.4.4 Deploying the Reference Implementation to the WebLogic Server

When the reference implementation (JRH90I33) is available on your deployment server, you use OMW to add it to your JDeveloper project. You then use a JD Edwards EnterpriseOne soft coding record to deploy the reference implementation to the WebLogic Server.

To deploy the reference implementation to the WebLogic Server:

Access OMW in JD Edwards EnterpriseOne.

  1. In OMW, search for and select object JRH90I33, and add the object to your project.

  2. Click Get (or Check-Out subsequently) to get the sources of the object to your local client.

  3. From OMW, invoke JDeveloper with project JRH90I33 selected.

  4. Open the Soft Coding Records application (P954000).

    If you are using a web service that is secured, you must pass values for all of the fields.

  5. If you are using an anonymous login, delete the username and password values.

    For example:

    <username></username>

    <password></password>

  6. Add the policy file, for example <Wssp1.2-2007-Https-UsernameToken-Plain.xml>, to the server domain folder location where the proxy project is deployed.

    This project RI uses the newly added API and fetches the softcoding record values as follows:

    softCodingRecord =            SoftCodingRecordAccess.getSoftCodingRecord(context, softCodingKey);                                                     
     
    use the API < getSoftcodingRecordFieldvalue(Context context,String fieldname, Element softCodingRecord )> to get the values for individual fields.
     
     // String url ="http://pc-asurendr-ptp:7001/DV812/RI_AddressBookManager";
        String url = SoftCodingRecordAccess.getSoftcoding RecordFieldvalue(context, "endpoint",softCodingRecord);                                                                  
     
               //2.String username = "weblogic";
       String username = SoftCodingRecordAccess.getSoftcoding RecordFieldvalue(context,"username", softCodingRecord);                                                                     
     
               //3.String password = "weblogic1";
       String password = SoftCodingRecordAccess.getSoftcoding                RecordFieldvalue(context,"password", softCodingRecord);                                                                     
     
              //4. Policy Name policyname = SoftCodingRecordAccess.getSoftcoding Record "Wssp1.2-2007-Https-UsernameToken-//Plain.xml";
         String policyname = Fieldvalue(context, "policy", softCodingRecord);               
                                                                         
              //5.Trustkey name
                // String trustKeyName = "DemoTrust.jks";
       String trustKeyName = SoftCodingRecordAccess.getSoftcoding                RecordFieldvalue(context,"trustkey",softCodingRecord);                                                                     
    
  7. Verify that the above code is added.

Note:

If you do not want to manually place the current security policy file (which is <Wssp1.2-2007-Https-UsernameToken-Plain.xml> to the WebLogic Server domain folder, where the business services server instance is installed and the proxy project is deployed, you must make the following code change in the JRH90I33 BSSV proxy project:

At line No 136 in the JRH90I33 code on Oracle Update Center, the replacement code is:

FileInputStream inbound = new FileInputsStream(policyname);

The policy name is taken from the Soft Coding Record. A sample value of policyname is:

Wssp1.2-2007-Https-UsernameToken-Plain.xml

With the above code, for the business service proxy object JRH90I33 to successfully consume a secure published business running on WebLogic Server, you must manually place the policy file in the WebLogic Server domain folder.

Note:

If you use the following code, you do not need to manually place the policy file in the WebLogic Server domain folder,

At line No 136 in the JRH90I33 code on Oracle Update Center, replace this code:

FileInputStreamInbound = new FileInputStream(policyname);

With this code:

Java.io.InputStream inbound = (new Object(().getClass().getResourceAsStream("/webLogic/wsee/policy/runtime/" + policyname);

This replacement code ensures that the policy file specified in "policyname" will be dynamically loaded when the business services proxy object running on WebLogic Server is trying to consume a secure web service, and it will use the inbound object created by the above line of code while calling the getRI_Addressbook ManagerHttpPort() API.

After you make a change, check in the modified JRH90I33 object, and build and deploy the business services package.

In summary, whenever you create a business service proxy object for a secure web service running on WebLogic Server, use this code to dynamically load the policy file during runtime:

getClass().getResosurceAsStream("/weblogic/wsee/policy/runtime/" + policyname);

3.5 Reference Implementation for Testing the Business Services Server as a JAX-WS Web Service Consumer (Release 9.1 Update 2)

The JAX-WS consumer business service reference implementation JRH90I34 can be used to test the business service consumer scenario against the target JAX-WS web service RI_AddressBookManager of the JPR01000 published business service project. The JAX-WS consumer reference implementation was developed using the WSDL of the JAX-WS web service RI_AddressBookManager running on the JDeveloper 11g integrated WebLogic server, and it will also work against the JAX-WS RI_AddressBookManager running on a standalone WLS/WAS.

The reference implementation AddressBook test application (P954001) calls the getAddressBook operation of the JAX-WS web service RI_AddressBookManager using the JAX-WS consumer business service JRH90I34. The web service retrieves the associated address book data based on the address book number that you enter in P954001. The web service sends the information back to P954001 using JAX-WS consumer business service JRH90I34. If the information for the address book record appears in P95400I, then the Business Services server is set up correctly for consuming JAX-WS web services.

The methodology in this section, which uses JRH90I34 to test the consumer scenario using a JAX-WS based proxy, can be used as a reference to test the consumption of other third-party JAX-WS web services.

3.5.1 Prerequisites

Before you perform the tasks in this section, you must:

  • Apply the ESU for business function B953002. B953002 has been changed so that it can call the JAX-WS Consumer RI JRH90I34.

  • Download and install the ESU for the JAX-WS business service consumer RI, JRH90I34, to the Deployment server.

    The ESUs that correspond to the following bug numbers must be installed for testing the Web Services Consumer scenario with the JAX-WS Business Service Consumer reference implementation JRH90I34.

    • Business Function B953002

      • EnterpriseOne Applications Release 9.0: Bug 14156492

      • EnterpriseOne Applications Release 9.1: Bug 14156483

    • Business Service JRH90I34

      • EnterpriseOne Applications Release 9.0: Bug 14124057

      • EnterpriseOne Applications Release 9.1: Bug 14124040

  • On the EnterpriseOne development client machine, using OMW, first Search for the JRH90I34 object and then do a Get operation in OMW to get the JRH90I34 object locally to <E1_Install_Path>\ DV900\java\source\oracle\e1\bssv\JRH90I34 location.

  • Ensure the JAX-WS published business service RI_AddressBookManager (of JPR01000 business service project) is up and running with the web service returning proper values for the getAddressBook operation. RI_AddressBookManager can be running on the JDeveloper 11g Integrated WLS or on a standalone WLS/WAS.

3.5.2 Configuring Reference Implementation JRH90I34 for Testing the JAX-WS Web Services Consumer Scenario

After you set up the prerequisites, you must perform these tasks before you can use the P954001 test program to run the getAddressBook operation of the JAX-WS web service RI_AddressBookManager using the JAX-WS consumer business service JRH90I34.

  1. Open the JRH90I34 business service project in JDeveloper 11g from OMW.

  2. Create and save a deployment profile for the JRH90I34 project.

    See "Creating a Deployment Profile for the Business Service Consumer Project" in the JD Edwards EnterpriseOne Tools Business Services Development Guide

  3. Start the integrated WebLogic server.

  4. Deploy the updated JRH90I34 project to the integrated WebLogic server.

    See "Deploying the Business Service to the Integrated WebLogic Server" in the JD Edwards EnterpriseOne Tools Business Services Development Guide

  5. Setup and activate an OCM record for the enterprise server to point to the business services server.

    The EnterpriseOne Web client user must have authority to work with the OCM application.

    • On the EnterpriseOne Web client, type GH9011 in the Fast Path.

    • Expand System Administration Tools, right click on Object Configuration Manager and click Versions.

    • Select version ZJDE0003 for the Object Configuration Manager version.

    • Select the appropriate data source.

      If you are using the local H4A, business functions will run locally in activeconsole, so use the local data source.

      If you are using a production environment, business functions will run on the enterprise server, so use the server data source.

    • Click Add to add a new OCM record, and enter the following information:

      • Environment Name: Your Test environment name.

      • Service Name: BSSV

      • User/Role: EnterpriseOne user ID, Role ID, or *PUBLIC.

      • Server: BSSV server name.

        If the consumer business service is running locally on the JDeveloper 11g integrated WebLogic server, use the machine name where JDeveloper 11g is installed.

      • Port: JDENET listening port on the business service server.

        The port name should be the same as the serviceNameListen in the jdeinterop.ini file.

    • Save the OCM record.

    • Activate the OCM record.

    • Test the connectivity with the Business Services server by selecting the OCM record, and then selecting Ping BSSV Server from the Row menu.

      Ensure the connection is successful.

    If you are using a production environment, restart the Enterprise server to load the new OCM entry. If you are using a local EnterpriseOne development client, log out and then log in again.

  6. Add a system-level service property record for the JRH90134 project.

    Open the Business Service Property Program (P951000).

    On Work with Service Property, click Add and enter the following information on the Add BSSV Property form:

    • Key: JRH90I30_APP_SERVER_OAS_OR_WAS_OR_WLS

    • Value: JAXWS

    • Level: System

    See "Adding a Business Service Property Record" in the JD Edwards EnterpriseOne Tools Business Services Development Guide

  7. Add a softcoding record for the JRH90I34 project.

    Open the Web Service Soft Coding Records program (P954000) from the EnterpriseOne Web client.

    On Work with Soft Coding, click Add, and enter the following information on the Add Web Service Soft Coding Record form:

    • User / Role: Enter the name of the user ID for testing.

    • Environment Name: Enter the name of the test environment.

    • Soft Coding Key: JRH90I34.

    • Soft Coding Value: Enter the following xml.

      <scwls>
      <endpoint>http://dngorajesvm4:7101/context-root-JPR01000/RI_AddressBookManagerPort?WSDL</endpoint>
      </scwls>
      

      Note:

      The endpoint points to the URL where the target JAX-WS web service is running. In the sample soft coding xml specified above, the endpoint is pointing to the target RI_AddressBookManager web service running locally on the JDeveloper 11g integrated WebLogic server. The web service running locally is not secured, so it is not required to specify user name and password fields in softcoding xml.

      If the target JAX-WS web service is secure and requires the WS-Security Header with user name and password credentials to be passed in the SOAP header, enter the masked user name and password values in the Enter Mask Fields section on the Update Web Service Soft Coding Record form and use the following xml in the Soft Coding Value field:

      <scwls>
      <endpoint>https://dnvmw8r201:9484/DV900/RI_AddressBookManager?WSDL</endpoint>
      <username>JDE</username>
      <password>_||_password_||_</password>
      </scwls>
      

      Note:

      The endpoint points to the RI_AddressBookManager JAX-WS web service running on a standalone WebLogic server.

      The password field in the softcoding XML is the Mask field in the Mask Fields grid and the actual value of the password is specified in the Mask For example the value for the user could be JDE, and the password could be JDE.

      Note:

      If the target web-service (JAX-WS consumer JRH90I34 is deployed to the integrated WLS of JDeveloper 12c) is secured with SSL, then in the Integrated WLS start script (startWebLogic.cmd), add the following argument to the JAVA_OPTION jvm arguments to ignore host name verification. (Release 9.1 Update 4)
      -Dweblogic.security.SSL.ignoreHostnameVerification=true
      

      The following is an example:

      set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.security.SSL. ignoreHostnameVerification=true
      

      Typically the start script startWebLogic.cmd is at this location:

      C:\Users\<user_name>\AppData\Roaming\JDeveloper \system12.1.2.0.40.66.68\DefaultDomain\bin\startWebLogic.cmd

3.5.3 Running Reference Implementation JRH90I34

After you configure reference implementation JRH90I34, do the following to run the JAX-WS based business service consumer scenario.

  • Restart the JDeveloper 11g integrated WebLogic server where the JAX-WS consumer reference implementation JRH90I34 is running.

  • Run the Reference Implementation AddressBook application (P954001) from the EnterpriseOne Web client by entering a valid address book number (such as 4242 or 1001), and then click the getAddressBookInfo button.

The application calls business function B953002, which makes a call to the JAX-WS business service consumer reference implementation JRH90I34. JRH90I34 invokes the getAddressBook operation of the target JAX-WS provider web service, RI_AddressBookManager, to fetch the address book record for address book number that you entered.

3.5.4 Troubleshooting Tips

If you have any issues while testing the consumer business service scenario, configure the following logs:

  • BSSV log.

    Use the jdelog.properties file in <E1_Install_Path>\ini\sbf folder if the JAX-WS consumer reference implementation is running locally on the JDeveloper 11g integrated WebLogic server.

  • Jde and JdeDebug logs in local or for the COK on the Enterprise server, depending on where business function B953002 is running.

  • IntegratedWeblogicServer log, which is located at:

    C:\Documents and Settings\USER_PROFILE\Application Data\JDeveloper\system11.1.1.3.37.56.60\DefaultDomain\servers\DefaultServer\logs

3.6 Java Client Reference Implementation for Media Object Operations (Release 9.1 Update 2)

The MOBSSVJavaClient reference implementation is a standalone media object client for the JPR01MO1 published business service. This reference implementation is delivered for JD EDwards EnterpriseOne Tools Release 9.1 Update 2 and later releases. The reference implementation is located on the development client at System/classes/samples.

The MOBSSVJavaClient reference implementation is a standalone program that runs from the command prompt. The program takes the end point URL of the JPR01MO1 program that is deployed on the Business Services Server as input and performs media object operations on that Business Services Server.

Before you can run the MOBSSVJavaClient reference implementation, the published business services project JRP01MO1 must be deployed to the Business Services Server.

The steps for building and running the MOBSSVJavaClient reference implementation are provided in the MOBSSVJavaClient_Readme.html file packaged along with the reference implementation.