ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used...

71
Creating a Business Service Wrapper for an E1 Business Function Author: D.Terborg Page | 1 of 71 Functional & Technical Specification Creating a Business Service Wrapper for an E1 Business Function ORACLE JD Edwards EntrepriseOne 8.12

Transcript of ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used...

Page 1: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 1 of 71

Functional & Technical Specification

Creating a Business Service Wrapper for an E1 Business Function

ORACLE

JD Edwards EntrepriseOne 8.12

Page 2: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 2 of 71

MODIFICATIONS

No

EDITION

No

REVISION

DATE

OBSERVATIONS

ACTIO

N

(*)

REF.

1.0 10/05/16 Document Creation

VALIDATION

Function

NAME

DATE

SIGNATURE

Analyst/Programmer D.Terborg 10/05/16

Page 3: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 3 of 71

Table of Contents

1. Functional Specifications..................................................................................................... 4

1.1. GENERAL DESCRIPTION ............................................................................................................................ 4 1.2. OBJECTIVE ............................................................................................................................................... 4 1.3. NAMING CONVENTIONS ........................................................................................................................... 4

2. OMW Steps ............................................................................................................................... 5

2.1. CRTEATE OMW BUSINESS SERVICE OBJECT ........................................................................................... 5

3. JDeveloper Steps .................................................................................................................... 9

3.1. CREATE THE VALUE OBJECT CLASS BASED ON BSFN DATA STRUCTURE INTERNAL FOR J55XXXXX .. 10 3.1. CREATE THE VALUE OBJECT CLASS BASED ON BSFN DATA STRUCTURE PUBLISHED FOR J55XXXXX . 17 3.2. CREATE THE INTERNAL BUSINESS SERVICE CLASS FOR J55XXXX ......................................................... 34 3.3. CREATE THE PUBLISHED BUSINESS SERVICE CLASS FOR JP55XXXX ..................................................... 38 3.4. ADD CODE TO THE PUBLISHED BUSINESS SERVICE CLASS ..................................................................... 42 3.5. CREATE CODE TO MAP BETWEEN PUBLISHED AND INTERNAL VALUE OBJECTS ....................................... 44 3.6. MAP FROM INTERNAL VALUE OBJECT TO PUBLISHED RETURN CLASS ..................................................... 46 3.7. ADD THE CODE TO CALL THE BUSINESS FUNCTION ................................................................................. 47

4. Check in Business Service ................................................................................................... 51

5. EnterpriseOne Security Setup ............................................................................................ 52

6. Testing BSSV......................................................................................................................... 55

6.1. CREATING A TEST CLASS: ...................................................................................................................... 55 6.1. CREATING A TEST WEB SERVICE: .......................................................................................................... 61

7. BSSV Debug .......................................................................................................................... 66

8. Notes ....................................................................................................................................... 68

8.1. FOLLOW THESE RULES WHEN YOU DEVELOP PUBLISHED BUSINESS SERVICE VALUE OBJECT CLASSES: ... 68 8.2. MAPPINGS .............................................................................................................................................. 68 8.1. BUSINESS SERVICE CLASS METHOD NAMING CONVENTIONS ................................................................ 69 8.2. FORMATTING INPUT/OUTPUT VALUES .................................................................................................... 69

8.2.1. Integer to Math Numeric ................................................................................................................. 69 8.2.2. BigDecimal to MathNumeric ........................................................................................................... 70 8.2.3. Calendar to Date: ............................................................................................................................ 70 8.2.4. mapFromPublished in Published Input VO: ................................................................................... 71

Page 4: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 4 of 71

1. FUNCTIONAL SPECIFICATIONS

1.1. GENERAL DESCRIPTION

Business Services are quickly becoming the preferred method of interfacing between 3 rd party applications and

JD Edwards EnterpriseOne.

Using Business Services you can expose web services functions to the outside world to give other applications

an industry standard method to interact with JD Edwards EnterpriseOne.

Business Service functions also give you the opportunity to call 3rd party web services.

Web services are becoming the standard method for unrelated applications to interact with each other.

In JD Edwards EnterpriseOne, Business Services are used to publish and consume web services.

1.2. OBJECTIVE

This article is written with the intent of providing you with a step by step guidance to help you learn how to

build your own Business Service function. This example will walk you through creating a business service

function that will simply call a JD Edwards EnterpriseOne Business Function.

I call this a Wrapper since it provides no other functionality beyond just calling the Business

Function.

The Wrapper Business Services can then be published allowing an outside application to call your JD

Edwards EnterpriseOne Business Function.

1.3. NAMING CONVENTIONS

For the Internal Business Service the naming of the OMW object is: J55XXXXX, in the description field it

would be recommendable to use “Internal” in the description.

For the Published Business Service the naming of the OMW object is: JP55XXXX, in the description field

it would be recommendable to use “Published” in the description.

Page 5: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 5 of 71

2. OMW STEPS

2.1. CRTEATE OMW BUSINESS SERVICE OBJECT

In OMW, click on Add.

On the next screen select “Business Function”

Click Ok

Page 6: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 6 of 71

On the Next screen you need to fill in the following fields

Object Name

Description

Install System Code

Reporting System Code

In the “Source Language” section, select BSSV

Page 7: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 7 of 71

When you select BSSV a new option will become available.

Click in the new field and use the Visual Assist.

On the new screen click Find

Select ‘oracle.bssv.e1’

Click on ‘Select’ to get back to the previous screen.

The result will be as the figure below:

Click ‘Ok’ to continue

Page 8: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 8 of 71

Repeat the previous described steps to create the OMW object for the Published Business Service.

If done correctly your OMW project should contain 2 objects that look similar to the figure below.

Highlight the Internal BSSV object and click on the ‘Design’ Button

Select the tab ‘Design Tools’

On the next screen click on ‘Invoke JDeveloper’

You’ll see screen as shown in the figure below, indicating it’s launching JDeveloper

Page 9: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 9 of 71

3. JDEVELOPER STEPS

You’ll be prompted with a ‘Save Files’ screen, just click ‘OK’

Depending in which environment you created your objects, you need to expand the tree until you see your BSSV

as a JDeveloper project

Page 10: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 10 of 71

3.1. CREATE THE VALUE OBJECT CLASS BASED ON BSFN DATA STRUCTURE INTERNAL

FOR J55XXXXX

These Value Object classes are used as data structures to pass data to and from the Business Service

functions.

Right click on the J55XXXXX project and select ‘New’ form the popup menu.

In the tree view on the left, click on Classes under EnterpriseOne.

Page 11: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 11 of 71

Select ‘Business Function Value Object Class’ in the list on the right.

Click on OK.

On the next screen fill in your Business Function in Object Name and click on Find

Highlight the Business Function you want and click on Next.

Page 12: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 12 of 71

On the next screen you need to select the Data Structure Members you want to use in your Business Service.

Select the members you want and click on Next.

Page 13: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 13 of 71

On the next screen you’re going to name and set your Value Object.

On this screen you determine whether it’s a published or internal Value Object.

As you are currently working on an Internal Business Service set the Scope to Internal and click on Finish.

Page 14: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 14 of 71

JDeveloper creates the new value object class based on the data structure members that you selected.

If you look at the file you will see each of the members defined in the class.

You will notice that each of them have been declared as private.

That means they can only be accessed from within the class itself.

Standard practice is to make these elements private and then create public functions that can be used to GET and

SET these values.

JDeveloper makes this easy.

Right click in the code page. Select Generate Accessors from the popup menu.

Page 15: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 15 of 71

Select all of the data members in the Generate Accessors screen. Click OK.

Page 16: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 16 of 71

Result should look like figure below:

Page 17: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 17 of 71

3.1. CREATE THE VALUE OBJECT CLASS BASED ON BSFN DATA STRUCTURE PUBLISHED

FOR J55XXXXX

The next step is to create the value object classes for the Published Business Service, based on

Business Function Data Structure Published classes.

These value object classes are used as data structures to pass data to and from the business service functions.

For this Published Business Service we need to create 2 value object classes.

One will be used as the structure to send values to the business service.

The second one will be the structure in which the data values will be returned.

Add your 2nd project (Published)

Create a new project to work with the new files we are creating.

Right click on the Environment in the tree view in the workspace pane, select New EnterpriseOne Project.

Page 18: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 18 of 71

On the next screen fill in the OMW Object name in Object Name and press Find.

Highlight the Grid line and press Finish.

If all done correctly the tree view pane will show your newly created project, as shown in the figure below:

Page 19: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 19 of 71

1st Value Object Class - Input Class (Super class)

Find your Published JP55xxxxxx project in the tree view in the work space Pane on the left.

Right click on the JP55xxxxxx project and select New form the pop up menu.

In the tree view on the left, click on Classes under EnterpriseOne.

Page 20: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 20 of 71

Select Business Function Value Object Class in the list on the right. Click on OK.

On the next screen fill in your Business Function in Object Name and click on Find

Page 21: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 21 of 71

Highlight the Business Function you want and click on Next.

Page 22: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 22 of 71

On the next screen you need to select the Data Structure Members you want to use in your Business Service as

Input.

Select the members you want and click on Next.

Page 23: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 23 of 71

On the next screen you’re going to name and set your Value Object.

On this screen you determine whether it’s a published or internal Value Object.

As you are currently working on a Published Business Service set the Scope to Publish and click on Finish.

Page 24: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 24 of 71

JDeveloper creates the new value object class based on the data structure members that you selected.

If you look at the file you will see each of the members defined in the class.

You will notice that each of them have been declared as private.

That means they can only be accessed from within the class itself.

Standard practice is to make these elements private and then create public functions that can be used to GET and

SET these values.

JDeveloper makes this easy.

Right click in the code page. Select Generate Accessors from the popup menu.

Select all of the data members in the Generate Accessors screen. Click OK.

Page 25: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 25 of 71

Result should look like figure below:

Page 26: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 26 of 71

2nd Value Object Class - Return Class (Super Class)

Find the new JP55XXXXXX project in the tree view in the work space Pane on the left.

Right click on the JP55XXXXXX project and select New form the pop up menu.

In the tree view on the left click on Classes under EnterpriseOne.

Page 27: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 27 of 71

Select Business Function Value Object Class in the list on the right.

Click on OK.

Page 28: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 28 of 71

On the next screen fill in your Business Function in Object Name and click on Find

Highlight the Business Function you want and click on Next.

Page 29: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 29 of 71

On the next screen you need to select the Data Structure Members you want to use in your Business Service as

Input.

Select the members you want and click on Next.

On the next screen you’re going to name and set your Value Object.

Page 30: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 30 of 71

On this screen you determine whether it’s a published or internal Value Object.

As you are currently working on a Published Business Service set the Scope to Publish and click on Finish.

JDeveloper creates the new value object class based on the data structure members that you selected.

Page 31: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 31 of 71

If you look at the file you will see each of the members defined in the class.

You will notice that each of them have been declared as private.

That means they can only be accessed from within the class itself.

Standard practice is to make these elements private and then create public functions that can be used to GET and

SET these values.

JDeveloper makes this easy.

Right click in the code page. Select Generate Accessors from the popup menu.

Select all of the data members in the Generate Accessors screen. Click OK.

The Output class that you just created needs to be changed from:

Page 32: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 32 of 71

ValueObject to MessageValueObject.

MessageValueObject is the typical value object class for Output value objects.

It includes an E1MessageList for returning warning and informational messages.

When the Output class is modified it will be underlined in red.

The red means JDeveloper doesn’t know what it is.

Place your cursor over the Value Object class name.

When the little blue popup shows up, hit Alt-Enter to import the file where

MessageValueObject is defined (oracle.e1.bssvfounation.base.MessageValueObject).

Imports work the same as include statements in C.

Page 33: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 33 of 71

You will notice the new line in the import section at the top for the code screen.

At the bottom of the Output class add a new constructor as shown below.

This class already has a default constructor, but we will need this new special constructor later.

Here’s where you going copy the Internal Value Object values to the Published Output class.

After creating the new constructor place your cursor over the Internal Value Object.

After the little blue popup shows up, hit Alt-Enter to import the file, where Internal_XXXXXXX is defined.

This will be the Internal Value Object class you created earlier.

Page 34: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 34 of 71

3.2. CREATE THE INTERNAL BUSINESS SERVICE CLASS FOR J55XXXX

Find the Internal J55XXXXXX project in the tree view in the work space Pane on the left.

Right click on the J55xxxxxx project and select New form the pop up menu.

In the tree view on the left click on Classes under EnterpriseOne.

Select Business Service Class in the list on the right.

Click on OK.

Page 35: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 35 of 71

Define the new Business class. This class will not be published it will only be accessible to other functions on

the Business Service server for testing purposes.

On the next screen enter a name for the class in Name.

Enter get_Name_Internal for the new method name.

Page 36: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 36 of 71

Browse for the input class. This will be the new internal value object class we created earlier.

Find the Internal value object class you created.

Click Open.

Page 37: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 37 of 71

With everything completed, Click OK.

The new Internal Business Service class will be generated with the get method.

At this point the class is just a skeleton and does nothing.

Page 38: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 38 of 71

3.3. CREATE THE PUBLISHED BUSINESS SERVICE CLASS FOR JP55XXXX

Find the Published JP55xxxxx project in the tree view in the work space Pane on the left.

Right click on the JP55xxxxx project and select New form the pop up menu.

In the tree view on the left click on Classes under EnterpriseOne.

Select Business Service Class in the list on the right.

Click on OK.

Page 39: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 39 of 71

Define the new Published Business class. This class will be Published.

A Published Business service class requires an Input value object class and an Output value object class.

Enter Published Input value object for the class name.

Enter Published Output value object for the new method name.

Browse for the input class. This will be the new value object class that you’ve created earlier.

Find the Published Input value object class you created.

Click Open.

Page 40: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 40 of 71

Browse for the output class. This will be the new Output value object class that you’ve created earlier.

Find the Published Output value object class.

Click Open.

Page 41: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 41 of 71

With everything completed, Click OK.

The new Published Business Service class will be generated with the get method.

At this point the class is just a skeleton and does nothing.

Page 42: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 42 of 71

3.4. ADD CODE TO THE PUBLISHED BUSINESS SERVICE CLASS

Find the protected method “Published method name” in the Published Business Service class.

Find the TODOs in the skeleton code and add new code so it matches below.

//Create a new internal value object.

Internal_XXXXX internalVO = new Internal_XXXXX();

//Call BusinessService passing context, connection and internal VO

E1MessageList mapMessages = vo.mapFromPublished(internalVO);

//TODO: Call BusinessService passing context, connection and internal VO

E1MessageList bssvMessages = Internal Business Service class.get_ Internal Business Service class

method_Internal(context,connection,internalVO);

//TODO: Add messages returned from BusinessService to message list for PublishedBusinessService.

messages.addMessages (bssvMessages);

If all is done correctly your screen will look something like figure below.

Page 43: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 43 of 71

You may need to use Alt-Enter to add some imports for the new code.

Do this for each object in your code that is underlined in red.

We haven’t written any code to call the E1 business function or to pass values back and forth yet so after all of

this work so far it still pretty much still does nothing.

Page 44: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 44 of 71

3.5. CREATE CODE TO MAP BETWEEN PUBLISHED AND INTERNAL VALUE OBJECTS

You will create a method in your Published value object class to map the Published members to the Internal

value object class, so we can pass the needed values to the internal business service class.

If any formatting, data conversion, or processing is required for the input values, it needs to happen in this

method.

Create the following method in the Published Input Value Object class.

public E1MessageList mapFromPublished (Internal_XXXXX vo) {

E1MessageList messages = new E1MessageList();

//Assign values from the published class to the internal vo object

vo.setMnInput_parameter(new MathNumeric(this.getInput_parameter()));

return messages;

}

Internal class

member

Published class

member

Page 45: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 45 of 71

In the next figure you can see the parameters used in the logic above:

Use Alt-Enter as needed to add the necessary import lines.

After import:

Notice how the type conversion is being done from Integer to the MathNumeric that is used by the internal value

object address number.

Page 46: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 46 of 71

3.6. MAP FROM INTERNAL VALUE OBJECT TO PUBLISHED RETURN CLASS

After the Internal Business Service class is called we need to return data back to the Output Value Object class

so it can be returned to the calling application.

Locate the new public constructor that you’ve added to the Output object class earlier (Output_xxxxxx).

Add the code as shown below. Using the accessors it will copy the values across.

You will notice some code that has underlines indicating compile issues.

These exist because of type conversion issues.

You need to create overloaded accessors to handle the type conversions.

Add the following accessors if needed:

For more examples look at section Formatting Input/Output Values

public Output_xxxxxx (Internal_xxxxx internalVO) {

//Copy the values from the internal VO to the published return class values.

this.setPublished_parameter (internalVO.getInternal_parameter());

this.setPublished_parameter (internalVO.getMnInternal_parameter());

}

//Convert MathNumeric to Integer.

public void setPublished_parameter (MathNumeric mnInternal_parameter) {

if (mnInternal_parameter != null)

this. Published_parameter = new Integer(mnInternal_parameter.intValue());

else

this. Published_parameter = new Integer (0);

}

//Convert Date.

public void setPublished_parameter (Date Internal_parameter) {

Calendar tempCalendar = Calendar.getInstance();

tempCalendar.setTime(Internal_parameter);

this. Internal_parameter = tempCalendar;

}

Page 47: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 47 of 71

3.7. ADD THE CODE TO CALL THE BUSINESS FUNCTION

Locate the get_Internalxxxxxx method in the Internal Business Service class in J55xxxxx.

On the blank line after the “TODO: call method…” line

Right click. Click on EnterpriseOne on the pop up menu.

Select Create Business Function Call.

Page 48: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 48 of 71

Enter your BSFN into object name. Click Find.

Select your BSFN. Click Next.

Page 49: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 49 of 71

Set the input and outputs as required for your BSFN.

The selection of the check boxes on each item creates the appropriate code to send data to the BSFN and return

data back.

The wizard creates a new method based on your input above. It creates a call to the new method on the line

where you invoked the wizard to call an E1 BSFN.

Verify the code looks the same as below adding code as necessary under the TODO reminder comments.

Notice that you’ve added code to the BSFN call line so you can return messages from the call.

Page 50: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 50 of 71

Scroll down to see the code as shown in the below figure:

You will notice some red underlines indicating a compile issue.

When the wizard created the new method calls the business function it specifies a generic InputVOType,

Scroll down.

You need to fix this to use the actual value object class that is being used. In this case we need to

replace InputVOType with Internal_Business Fucntion Value Object.

At this point, everything should compile.

Make the business service projects.

Highlight each project and click on the Make button to compile.

Resolve any compile errors.

Page 51: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 51 of 71

4. CHECK IN BUSINESS SERVICE

When checking the Business Service in you have the opportunity to decide which Artifacts should be included in

the check-in.

You will also specify which class will be a published class.

Only the specified class will be built as a web service on the business services server.

Select JP55xxxx and click on the check-in button.

The green check marks indicate which Artifacts will be checked in.

Clicking on the row header will check and uncheck the Artifact. I always leave them all checked.

Select the class that you want to publish. Click on Published Business Service class.java.

Click on Row Exit Set Published.

This will toggle identifying the class as published or not.

It will then display the selected class in the Published Class Name, to confirm which one you selected.

Page 52: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 52 of 71

5. ENTERPRISEONE SECURITY SETUP

Before you can continue with testing your you need to make sure that the security is setup for your Business

Service.

Security Workbench

By default, when installing E1, security for Business Services is configured to restrict all users, to invoke any

Business Service. JPR01000 (at a minimum) must be added in Security Workbench so the User Id for the User

testing JPR01000 (or *PUBLIC) is allowed to execute the Business Service.

Enter P00950 in the Fast Path, and press ENTER

Select the last Form Exit Published BSSV.

In Published Business Services Security Revision, Select Secure by Method from the Form Exit.

Page 53: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 53 of 71

In Secure by Method, enter your Published Business Services and press Find.

You can also enter the User ID you are setting the security for or *PUBLIC.

Select/Highlight the Business Service you want and press Allow Execute.

Once you completed the Allow or Disallow, click on Close to return to the previous screen.

Page 54: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 54 of 71

On returning to Published Business Service Security Revision screen, it should resemble the figure below:

Click Ok to return to Work With User/Role Security screen

Click Close to exit the Security Workbench application.

Page 55: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 55 of 71

6. TESTING BSSV

There are 2 methods to test your Business Service.

Below you’ll get a description how to test your Business Service.

6.1. CREATING A TEST CLASS:

The 1st method to test your Business Service:

You create a test class to make it easier to run the process over and over.

It is very useful for troubleshooting.

Find the Internal Jxxxx project in the tree view in the work space Pane on the left.

Right click on the Internal Jxxxx project and select New form the pop up menu.

Page 56: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 56 of 71

In the tree view on the click on General. Select Java Class in the list on the right. Click on OK.

Page 57: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 57 of 71

On the next screen define the new java class you will use for testing.

Enter Test_xxxxxx for the class name.

Click on Generate Main Method.

Click OK.

Your new Java class might like look figure below:

Page 58: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 58 of 71

Add the following code to the new java class.

public class Test_xxxxx {

/**

* Main Method used for executing test methods as an application.

*/

public static void main(String[] args) throws BusinessServiceException {

try {

//Call required before running a test harness using application (main()).

TestBusinessService.startTest();

/* add code here to map output from Internal value object to the Output Published Business Service

value object */

Published INPUT value object p = new Published INPUT value object ();

//Set Input Parameters

p.setAddressNumber(new Integer(5039072)); /* Test value */

Published Business Service class vddp = new Published Business Service class ();

E1MessageList el;

Published Output value object s = null;

try {

s = vddp.Published Business Service Class method name(p);

} catch (BusinessServiceException e) {

e.printStackTrace(System.out);

} catch (Exception e) {

e.printStackTrace(System.out);

} finally {

if (s != null) {

System.out.println(s.toString());

}

}

} finally {

//Call required after test is complete. Needed to clean up daemon threads.

TestBusinessService.finishTest();

}

}

}

Page 59: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 59 of 71

If all is done correctly you’re code should like figure below:

Use Alt-Enter to add the import statements as needed.

BusinessServiceException should use oracle.e1.bssvfoundation.exception.

Click on Save

Page 60: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 60 of 71

Make/Compile the new java class.

Select the test class you’ve created.

Click on the Run button.

You should see output that looks something like the figure below:

Page 61: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 61 of 71

6.1. CREATING A TEST WEB SERVICE:

The 2nd method to test your Business Service:

Depending in which environment you logged in, you should see your BSSV and all of its classes

Right click on your Published BSSV Class, and select Create J2EE Web Service.

Page 62: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 62 of 71

On the Select J2EE Web Service Version screen, just click on OK without changing anything.

Give a name to your Web Service, and click Next

Page 63: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 63 of 71

On the Next screen (Message Format) Change the SOAP Message Format to Document/Literal and click Finish

Page 64: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 64 of 71

In order to deploy the business service application to the embedded JDeveloper OC4j, the BSSV application

needs to be running.

Right click on your Test Web Service you’ve just created

Click on RUN

Once the service is running, click on the target URL shown in the log window (as shown below)

Page 65: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 65 of 71

A test window will be displayed. Un-check all values except the field which you want to enter a value in for

testing.

Make sure the WS-Security check box is unchecked.

Populate the fields you want.

Click Invoke

Page 66: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 66 of 71

7. BSSV DEBUG

To debug your BSSV you need to set Break Points where you want the program to stop, to allow you to evaluate

the values being passed in or out.

To make it more understandable we need first to understand the logic flow of the BSSV’s.

As shown below, the Published BSSV will be called first and secondly the Internal BSSV as this is being called

from the Published BSSV

Set Break Point where you want the program to stop for evaluation

You set your mouse on the line number and click:

No Breakpoint:

Breakpoint set:

Published BSSV

Input

Internal BSSV

Output

Page 67: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 67 of 71

In the next step Right click on the Value Object that you are using to test your BSSV’s and click on Debug

If you’ve set the Break Point correct the program will stop at that point:

Page 68: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 68 of 71

8. NOTES

A business service can be created in a utilities package (oracle.e1.bssv.util) if the business service provides a

repeatable task that is consumed by multiple other business services.

All other business services and published business services are created with the root package name

(oracle.e1.bssv).

8.1. FOLLOW THESE RULES WHEN YOU DEVELOP PUBLISHED BUSINESS SERVICE VALUE

OBJECT CLASSES:

Implement the serialize interface for all published value objects. This facilitates exposing the published

business service as a web service.

Initialize published business service value object compound attributes. This is to prevent null pointer

exceptions when the method calls accessors.

Expose published business service value object compound collections as arrays. Collection objects such

as an ArrayList cannot be exposed from a web service at this time.

Do not change published value objects, because the change breaks the contract that was created by the

original value object. This is to support backwards compatibility.

Do not add a new field, because this breaks the original contract that was set by the value object. You

must create a new version of the value object and method.

Create response value objects that contain a complete message (more than just keys).

Place mappings between published and internal value objects in a method in the published value object.

8.2. MAPPINGS

The mapping between the published value object and the internal value object takes place in the published value

object. You create a method for mapping fields from the published value object to the corresponding fields of the

internal value object.

If you call the Formatter utility or a business service utility when mapping data from published to internal value

objects, Oracle recommends that you create a method named mapFromPublished that returns an E1MessageList.

The mapFromPublished method takes at a minimum the internal value object as a parameter.

This method holds all of the mappings between the published value object and the internal value object.

If a message could be returned to the published business service, you should create a method for mappings.

You should always create a method to return messages when you call a business service utility or the Formatter

utility during mapping.

If no messages would be returned from mappings, you can have the method return void.

Page 69: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 69 of 71

8.1. BUSINESS SERVICE CLASS METHOD NAMING CONVENTIONS

Just a quick not to make you aware that your Business Service may fail, if your Business Service is ran using

WebSphere.

A problem I’ve encountered is that I’ve used a Method name with Upper class.

When the Business Service was called, it converted the method name from an Upper case to a lower case.

ie. TestMethodName in JDeveloper no problems. When called on the server: testMethodName

This will result in an error as testMethodName does not exist in your Business Service Class

Check out this link

8.2. FORMATTING INPUT/OUTPUT VALUES

When you map data between published and internal value objects, data type transformations may be required.

The business service foundation provides methods and constructors that format data and transform data types.

Data type transformations that are done in the mappings are:

Integer to and from MathNumeric

BigDecimal to and from MathNumeric

8.2.1. Integer to Math Numeric

Mapping between Published integer fields and Internal math numeric fields requires a data type

transformation.

You use the set methods of the internal value object to make these transformations.

An overloaded method takes either an integer or a math numeric data type when setting the field value.

The same rule applies to mapping between big decimal and math numeric fields.

The business service foundation provides multiple math numeric constructors.

The null check is performed because the constructor throws an error if a null parameter is passed.

Internal Value Object (VO): public void setMnShortItemNumber(MathNumeric mnShortItemNumber) { ← This is the standard ‘setter’

method this.mnShortItemNumber = mnShortItemNumber; } public void setMnShortItemNumber(Integer mnShortItemNumber) { ← This is the new overloaded ‘setter’ method if (mnShortItemNumber != null){ this.mnShortItemNumber = new MathNumeric(mnShortItemNumber); } }

Page 70: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 70 of 71

8.2.2. BigDecimal to MathNumeric

8.2.3. Calendar to Date:

Internal Value Object (VO): public void setMnTransactionQty(MathNumeric mnTransactionQty) { ← This is the standard ‘setter’ method this.mnTransactionQty = mnTransactionQty; } public void setMnTransactionQty(BigDecimal mnTransactionQty) { ← This is the new overloaded ‘setter’ method if (mnTransactionQty != null) { this.mnTransactionQty = new MathNumeric(mnTransactionQty); } }

Internal Value Object (VO): public void setJdTransactionDate(Date jdTransactionDate) { ← This is the standard ‘setter’ method this.jdTransactionDate = jdTransactionDate; } public void setJdTransactionDate(Calendar jdTransactionDate) { ← This is the new overloaded ‘setter’ method if (jdTransactionDate != null) { this.jdTransactionDate = jdTransactionDate.getTime(); } }

Page 71: ORACLE JD Edwards EntrepriseOne 8 - JDE Source JD Edwards EnterpriseOne, Business Services are used to publish and consume web services. 1.2. OBJECTIVE

Creating a Business Service

Wrapper for an E1 Business

Function

Author: D.Terborg

P a g e | 71 of 71

8.2.4. mapFromPublished in Published Input VO:

public E1MessageList mapFromPublished(IContext context, InternalDetailsVO internalDetail) { E1MessageList retMessages = new E1MessageList(); internalDetail.setMnShortItemNumber(this.getItemId()); internalDetail.setMnTransactionQty(this.getTransactionQuantity()); internalVO.setJdTransactionDate(this.getTransactionDate()); return retMessages; }