B Testing a Business Service That Consumes an External Web Service

This appendix contains the following topics:

B.1 Creating a Test Business Service

To create a business service that tests the business service that calls a web service and passes an XML file:

  1. Create a test business service object in OMW.

  2. Move the generated sample XML file to the test business service folder.

    See Generating a Sample XML Document

  3. Add a call to the TestServiceBusinessFunction.callBSSVWithXMLFile method.

You can use this example code to create a business service to test calling a business service that passes an XML file.

Package oracle.e1.sbf.JTR"H90I10;

Import oracle.e1.sbffoundation.base.TestServiceBusiness Function; 
Import oracle.e1.sbffoundation.connection.Iconnection; 

Public class RI_AsyncSendEmailProcessor Test {  
     Public RI_AsyncSendEmailProcessorTest() {  
     }  

     public static void main(String[] args) {    
        Try {       
          //call required prior to executing test from application (main())
          TestServiceBusinessFunction.startTest();
          String file = "C:\\B9\STAGINGA\\java\\source\\oracle\\e1\\sbf\\
JTRH90I10\\SendEmailVO1.xml";

TestServiceBusinessFunction.callSBFWithXMLFile("oracle.e1.sbf.JRH90I20.
RI_AsyncSendEmail Processor",
                                             "sendEmail";
                                             File,
                                             IConnection.AUTO);
         } finally {
           //call required at the end of testing from application (main())
           TestServiceBusinessFunction.finishTest();
         }
     }
}

B.2 Using the Development Business Services Server

You can do end-to-end testing of your outgoing web service calls on a development business services server. You deploy the business service that calls a web service to a WebSphere Express instance. You can then use the web development client to run the application that calls the business function, which in turn calls the business service. You can perform the entire test from your web development client. The development business services server uses the WebSphere Express instance that is being used to run HTML applications on the web development client.

Before you deploy the development business services server, you must prepare the configuration files. This topic also discusses how to start and stop the development business services server.

B.2.1 Prerequisites

Before you complete the tasks in this section, verify that:

  • The web development client is installed and operational.

    The development business services server and web development client use the same application (WebSphere Express).

  • You have a business function that calls a business service method, and you have an application that calls the business function.

  • OCM is configured to send business service messages to a local business services server.

B.2.2 Preparing Configuration Files

The development business services server packages the business services server development configuration files, which are in <Path_Code>/ini/sbf), in an EAR file to be deployed.

You edit the JDELOG.PROPERTIES file to get the log files in the required path. The default JDELOG.PROPERTIES file that is installed with the development business services server provides a relative path to the log folder. The JDELOG.PROPERTIES file is in the <Path_Code>/ini/sbf folder. The relative path in the file is evaluated from this folder to get to the log folder location. The relative path changes when you are working with the development business services server. Because the JDELOG.PROPERTIES file is packaged in an EAR file and the EAR file is deployed in a WebSphere instance, the relative path to the log folder may not be valid. Oracle recommends that you use the complete path in JDELOG.PROPERTIES when working with the development business services server.

B.2.3 Deploying a Development Business Services Server

You deploy a development business services server from the JDeveloper Applications Navigator. Right-click the business service workspace, and then select Deploy Development BSSV Server from the context menu.

A dialog box for providing HTTP proxy configurations appears.

The HTTP proxy server parameters that were previously set in the configuration file are displayed. You can change any of these parameters. If you change the HTTP proxy parameter values while the business services server is running, the server might send a prompt indicating that the server will be restarted. Any existing application sessions on the web development client will be terminated. You should save all work before continuing with the restart.

Deployment time varies based on the various parameters. If you are using WebSphere and deploying for the first time, profile creation could take up to 10 minutes. The deploy status is visible in the JDeveloper status window with the title Apache Ant - Log. You can continue with other work while deployment is in progress. You must not stop the JD Edwards EnterpriseOne Solution Explorer (which also stops the WebSphere Express application) while deployment is in progress.

If the development business services server is already installed on the business services server, the previous version is automatically undeployed before the system continues the deployment process. When the deployment is finished, the Apache Ant - Log window displays a message indicating that the build and deploy was successful. The development business services server is now started and ready to accept requests.

B.2.4 Start or Stop a Development Business Services Server on WebSphere Express

On WebSphere Express, the business services server runs in a server profile called DEVBSSVSvr. This is separate from the application server instance for HTML applications, which runs in default profile. Therefore, starting and stopping JD Edwards Solution Explorer has no effect on the business services server. The easiest way to restart the business services server is to redeploy using the Deploy menu item.

Use this code to stop the development business services server:

<WebSphere Install Location>/profiles/DevBSSVSvr/bin/stopserver server1

Use this code to start the development business services server:

<WebSphere Install Location>/profiles/DevBSSVSvr/bin/startserver server1