bss v wrapper for function beebe 852

36
7/23/2019 Bss v Wrapper for Function Beebe 852 http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 1/36  Copyright © 2013 by Klee Associates, Inc. www.ERPtips.com Creating a Business Services Wrapper for an E1 Business Function By Scott Beebe Editor's Note: Scott Beebe, Worldwide Software, JDE ToolsPlus.com, shared with JDEtips this article that he had previously posted on his own site. The article serves as a vital introduction to how to get your JDE system to play nice with third-party web services and applications. Business services is quickly becoming the preferred method of interfacing between third-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 E1. Business service functions also give you the opportunity to call third-party web services. Web services is becoming the standard method for unrelated applications to interact with each other. In E1, business services is used to publish and consume web services. This article was written with the intent of providing you with a “Hello World” type of exercise to help you learn how to build your first business service function. This example will walk you through creating a business service function that will simply call an EnterpriseOne function. I call this a wrapper since it provides no other functionality beyond just calling the function. The wrapper business service can then be published, allowing an outside application to call your E1 business function. Before starting this exercise, create a simple business function that takes an address number for an input and returns basic address book info: Alpha Name, Address Line 1, Address Line 2, City, State, Zip, Date Last updated, Time Last updated. This business function includes all the common data types that we will normally deal with. The instructions below are the steps required to build a business services wrapper for this function. This document assumes that business services are properly setup on E1 development workstation. If trying to walk through for a training exercise, you will need to change object and class names from this example. Create the BSSV Functions That Will Be Needed JP550001 This will be the published business services class. 1. In OMW, click on Add. 2. Select the Business Function radio button, click OK. 3. Enter the following information on the next screen. Object Name JP550001 Description Published Get AB Info December 2013 Technical/ Customizing EnterpriseOne

Upload: sandeep9008860100

Post on 18-Feb-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 1/36

 

Copyright © 2013 by Klee Associates, Inc.

www.ERPtips.com 

Creating a Business Services Wrapper for an E1 Business FunctionBy Scott Beebe

Editor's Note: Scott Beebe, Worldwide Software, JDE ToolsPlus.com, shared with JDEtips this article that he hadpreviously posted on his own site. The article serves as a vital introduction to how to get your JDE system to play nicewith third-party web services and applications.

Business services is quickly becoming the preferred method of interfacing between third-party applicationsand 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 E1. Business servicefunctions also give you the opportunity to call third-party web services. Web services is becoming thestandard method for unrelated applications to interact with each other. In E1, business services is used topublish and consume web services.

This article was written with the intent of providing you with a “Hello World” type of exercise to help you learnhow to build your first business service function. This example will walk you through creating a businessservice function that will simply call an EnterpriseOne function. I call this a wrapper since it provides no otherfunctionality beyond just calling the function. The wrapper business service can then be published, allowingan outside application to call your E1 business function.

Before starting this exercise, create a simple business function that takes an address number for an inputand returns basic address book info: Alpha Name, Address Line 1, Address Line 2, City, State, Zip, DateLast updated, Time Last updated. This business function includes all the common data types that we willnormally deal with. The instructions below are the steps required to build a business services wrapper for

this function.

This document assumes that business services are properly setup on E1 development workstation. If tryingto walk through for a training exercise, you will need to change object and class names from this example.

Create the BSSV Functions That Will Be Needed

JP550001

This will be the published business services class.

1. In OMW, click on Add.

2. Select the Business Function radio button, click OK.

3. Enter the following information on the next screen.

Object Name JP550001

Description Published Get AB Info

December 2013 Technical/Customizing EnterpriseOne

Page 2: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 2/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 2 

Package Prefix oracle.e1.bssv

Product Code 55

Product System Code 55

Source Language BSSV

On the OMW-Business Function Design screen, click OK to return to OMW screen.

J550001

This will be the internal business service class that will be called from the published business services.

1. In OMW, click on Add.

2. Select the Business Function radio button, click OK.

3. Enter the following information on the next screen.

Object Name J550001

Description Internal Get AB Info

Package Prefix oracle.e1.bssv

Product Code 55

Product System Code 55

Source Language BSSV

On the OMW-Business Function Design screen, click OK to return to OMW screen.

Start up JDeveloper and Set up the First Project (J550001)

1. In OMW select J550001, click on the design button on the middle toolbar.

2. Click on the Invoke JDeveloper button.

3. When JDeveloper starts it will prompt to save selected files. This is normal; just click OK.

Page 3: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 3/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 3 

4. Create a new project to work with the new files we are creating. Right click on DV900 in the treeview in the workspace pane, select New EnterpriseOne Project.

5. If you don’t see the next screen, just click on Next to get to it. Enter J550001 in the object namefield, click Find. Select J550001 in the grid, click on Finish. If prompted to override the existingproject file, click on Yes.

Page 4: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 4/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 4 

Create the Value Object Class Based on BSFN Data Structure: Internal forJ550001

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

1. Find the new J550001 project in the tree view in the workspace pane on the right. Right click on theJ550001 project and select New from the popup menu.

Page 5: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 5/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 5 

2. In the tree view on the left, click on Classes under EnterpriseOne. Select Business Function ValueObject Class in the list on the right. Click on OK.

Page 6: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 6/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 6 

3. Click Next through this screen.

4. Enter N550001 in the Object Name field, click on Find. Select the GetABInfo function in the grid,click Next.

5. This screen shows all of the elements from the data structure for the GetABInfo function. Since wewant to use all of the elements, select all of them. Click on Select All.

Page 7: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 7/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 7 

6. Give the value object a name and select Scope. This value object will not be published; it will onlybe accessible to other functions on the BSSV server.

a. Enter InternalGetABInfo for the name.

b. Set Scope to be Internal.

7. JDeveloper creates the new value object class based on the data structure members that youselected. If you look at the file you will see each of the members defined in the class. You willnotice that all of them have been declared as private. That means they can only be accessed fromwithin the class itself. Standard practice is to make these elements private and then create publicfunctions that can be used to GET and SET these values. JDeveloper makes this easy.

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

Page 8: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 8/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 8 

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

Create the 2nd Project (JP550001)

1. Create a new project to work with the new files we are creating. Right click on DV900 in the treeview in the workspace pane, select New EnterpriseOne Project.

Page 9: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 9/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 9 

2. If you don’t see the next screen, just click on Next to get to it. Enter JP550001 in the object namefield, click Find. Select JP550001 in the grid, click on Finish. If prompted to override the existingproject file, click on Yes.

Page 10: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 10/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 10 

Create the Value Object Classes Based on BSFN Data Structure: Publishedclasses for JP550001

These value object classes are used as data structures to pass data to/from the business service functions.JP550001 will be the published business service class. For this class we need to create two value object

classes. One will be used as the structure to send values to the business service. The second one will bethe structure in which the data values will be returned.

First value object class  – Input Class

1. Find the new JP550001 project in the tree view in the work space pane on the right. Right click onthe JP550001 project and select New from the pop up menu.

2. In the tree view on the left, click on Classes under EnterpriseOne. Select Business Function ValueObject Class in the list on the right. Click on OK.

Page 11: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 11/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 11 

3. Click Next through this screen.

4. Enter N550001 in the Object Name field, click on Find. Select the GetABInfo function in the grid,click Next.

Page 12: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 12/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 12 

5. This screen shows all of the elements from the data structure for the GetABInfo function. Onlyselect the data members that will allow input into the function. In our case only the address booknumber is an input parameter.

a. Click on the check box next to mnAddressNumber.

6. Give the value object a name and select Scope. This value object will be published.

a. Enter GetABInfo for the name.

b. Set Scope to be Publish.

Page 13: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 13/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 13 

7. JDeveloper creates the new value object class based on the data structure members that youselected. If you look at the file you will see each of the members defined in the class. You willnotice that all of them have been declared as private. That means they can only be accessed fromwithin the class itself. Standard practice is to make these elements private and then create publicfunctions that can be used to GET and SET these values. JDeveloper makes this easy.

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

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

Page 14: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 14/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 14 

Second value object class  – Return Class

1. Find the new JP550001 project in the tree view in the work space pane on the right. Right click onthe JP550001 project and select New from the pop up menu.

Page 15: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 15/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 15 

2. In the tree view on the left click on Classes under EnterpriseOne. Select Business Function ValueObject Class in the list on the right. Click on OK.

Page 16: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 16/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 16 

3. Click Next through this screen.

4. Enter N550001 in the Object Name field, click on Find. Select the GetABInfo function in the grid,click Next.

5. This screen shows all of the elements from the data structure for the GetABInfo function. Onlyselect the data members that will return values. In our case all but the Address number will beoutput parameters.

a. Click Select All.

b. Deselect mnAddressNumber.

Page 17: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 17/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 17 

6. Give the value object a name and select Scope. This value object will be published.

a. Enter ReturnABInfo for the name.

b. Set Scope to be Publish.

7. JDeveloper creates the new value object class based on the data structure members that youselected. If you look at the file you will see each of the members defined in the class. You willnotice that all of them have been declared as private. That means they can only be accessed from

Page 18: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 18/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 18 

within the class itself. Standard practice is to make these elements private and then create publicfunctions that can be used to GET and SET these values. JDeveloper makes this easy.

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

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

8. The superclass for the two value object classes we just created need to be changed fromValueObject to MessageValueObject. MessageValueObject is the typical value object superclassfor output value objects. It includes an E1MessageList for returning warning and informationalmessages.

a. When the superclass is modified it will be underlined in red. The red means JDeveloperdoesn’t know what it is. 

b. Place your cursor over the superclass 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 includestatements in C.

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

9. At the bottom of the RetrunABInfo class, add a new constructor as shown below. This classalready has a default constructor, but we will need this new special constructor later.

a.   After creating the new constructor place your cursor over the InternalGetABInfo. After the

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

defined. This will be the new internal value object class we created earlier .

Page 19: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 19/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 19 

Create the Internal Business Service Class: Internal for J550001

1. Find the J550001 project in the tree view in the work space pane on the right. Right click on theJ550001 project and select New from the pop up menu.

2.  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 20: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 20/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 20 

3. Define the new business class. This class will not be published; it will only be accessible to otherfunctions on the BSSV server.

a. Enter ABInfoTest for the class name.

b. Enter getABInfoInternal for the new method name.

c. Browse for the input class. This will be the new internal value object class we createdearlier. Find the InternalGetABInfo value object class.

d. Click OK.

Page 21: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 21/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 21 

4. The new internal business service class will be generated with the get method. At this point theclass is just a skeleton and does nothing.

Create the Published Business Service Class: Published Class for

JP5500015. Find the JP550001 project in the tree view in the work space pane on the right. Right click on the

JP550001 project and select New from the pop up menu.

6. In the tree view on the left click on Classes under EnterpriseOne. Select Published BusinessService Class in the list on the right. Click on OK.

Page 22: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 22/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 22 

7. Define the new published business class. This class will be published. A published businessservice class requires an input value object class and an output value object class.

a. Enter ABInfoTestPub for the class name.

b. Enter getABInfo for the new method name.

c. Browse for the input class. This will be the new value object class we created earlier. Findthe GetABInfo value object class.

d. Browse for the output class. This will be the new value object class we created earlier.Find the ReturnABInfo value object class.

e. Click OK.

Page 23: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 23/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 23 

8. The new published business service class will be generated with the get method. At this point theclass is just a skeleton and does nothing.

Add Some Code to Do the Work

 At this point we have skeletons for all of the classes that we need. It will compile and run, but that is it. Nowwe need to make it do something.

1. Find the protected method GetABInfo in the ABInfoTestPub class.

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

//Create a new internal value object.

InternalGetABInfo internalVO = new InternalGetABInfo();

//Call BusinessService passing context, connection and internal VO

E1MessageList bssvMessages = ABInfoTest.getABInfoInternal(context,connection,internalVO);

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

messages.addMessages (bssvMessages);

Page 24: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 24/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 24 

3. You may need to use Alt-Enter to add some imports for the new code. Do this for each object inyour code that is underlined in red.

4. Make the business service projects. Highlight each project and click on the Make button to compile.Resolve any compile errors.

Page 25: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 25/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 25 

Create a Test Class

We create a test class to make it easier to run the process over and over. It is very useful fortroubleshooting. Our business service classes don’t really do anything yet, but it is a good time to create andverify the test class works properly.

1. Find the J550001 project in the tree view in the work space pane on the right. Right click on theJ550001 project and select New from the pop up menu.

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

Page 26: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 26/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 26 

3. Define the new Java Class we will use for testing.

a. Enter GetABTestClass for the class name.

b. Click on Generate Main Method.

c. Click OK.

4. Add the following code to the new Java Class. Include testGetABInfo anywhere inside the class.

Page 27: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 27/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 27 

public static void testGetABInfo() throws BusinessServiceException {

//instantiate the ABInfo class

ABInfoTestPub ABInfo = new ABInfoTestPub();

//Instantiate and/or declare the needed data structures

GetABInfo inputVo = new GetABInfo();

ReturnABInfo returnVo;

//Call the business service

inputVO.setAddressNumber(new Integer(3000)); //Pick a valid address

book number for the test.

returnVo = ABInfo.GetABInfo(inputVo);

//Output some info so we can see if it worked or not.

System.out.println("Message List");

System.out.println(returnVo.getE1MessageList().getMessagesAsString());

System.out.println("AB Info");

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

}

Note: Be sure to add “throws BusinessServiceException” on the main declaration. 

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

try {TestBusinessService.startTest();

testGetABInfo();

}

finally {

TestBusinessService.finishTest();

}

5. Use Alt-Enter to add the import statements as needed. BusinessServiceException should useoracle.e1.bssvfoundation.exception.

6. Click on Save

7. Make/Compile the new Java Class.

8. Click on Run to run the process.

Page 28: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 28/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 28 

9. We haven’t written any code to call the E1 business function or to pass values back and forth yetso after all of this work so far it still pretty much still does nothing.

Create Code to Map Between Published and Internal Value Objects

Map from Published to Internal value object

We will create a method in our published value object class to map the published members to the internalvalue object class so we can pass the needed values to the internal business service class. If anyformatting, data conversion, or processing is required for the input values, it needs to happen in this method.In our case it is very simple. We are only mapping the address book number across.

1. Create the following method in the GetABInfo value object class.

public E1MessageList mapFromPublished (InternalGetABInfo vo) {

E1MessageList messages = new E1MessageList();

//Assign values from the published class to the internal vo objectvo.setMnAddressNumber(new MathNumeric(this.getAddressNumber()));

return messages;

}

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

3. Notice how the type conversion is being done from integer to the MathNumeric that is used by theinternal value object address number.

4. Return to the ABInfoTestPub Class. Locate the protected method again. Add the highlighted code.Right after the internalVO class is instantiated call the mapFromPublished method.

Page 29: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 29/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 29 

//Create a new internal value object.

InternalGetABInfo internalVO = new InternalGetABInfo();

//Copy the values from the published VO and copy to the internal VO

E1MessageList mapMessages = vo.mapFromPublished(internalVO);

//Call BusinessService passing context, connection and internal VO

E1MessageList bssvMessages = ABInfoTest.getABInfoInternal(context,connection,internalVO);

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

messages.addMessages (bssvMessages);

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 return value object class

so it can be returned to the calling application.1. Locate the new public constructor that we added to the return object class earlier (ReturnABInfo).

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

public ReturnABInfo (InternalGetABInfo internalVO) {

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

this.setAddressLine1(internalVO.getSzAddressLine1());

this.setAddressLine2(internalVO.getSzAddressLine2());

this.setCity(internalVO.getSzCity());

this.setState(internalVO.getSzState());

this.setPostalCode(internalVO.getSzZipCodePostal());this.setNameAlpha(internalVO.getSzNameAlpha());

this.setDateUpdated(internalVO.getJdF0101DateLastUpdated());

this.setTimeLastUpdated(internalVO.getMnF0101TimeLastUpdated());

}

3. You will notice some code that has underlines indicating compile issues. These exist because oftype conversion issues. We need to create overloaded accessors to handle the type conversions.

 Add the following accessors.

Page 30: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 30/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 30 

public void setTimeLastUpdated(MathNumeric timeLastUpdated) {

if (timeLastUpdated != null)

this.timeLastUpdated = new Integer(timeLastUpdated.intValue());

else

this.timeLastUpdated = new Integer (0);

}

public void setDateUpdated(Date dateUpdated) {

Calendar tempCalendar = Calendar.getInstance();

tempCalendar.setTime(dateUpdated);

this.dateUpdated = tempCalendar;

}

4. Do a Save All

Add the Code to Call the Business Function

1. Locate the getABInfoInternal method it the ABInfoTest in J550001.

2. Right click on the blank line after the “TODO: call method…” line. Click on EnterpriseOne on thepop up menu, select Create Business Function Call.

Page 31: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 31/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 31 

3. Enter N550001 into object name. Click Find.

4. Select the GetABInfo function. Click Next.

Page 32: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 32/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 32 

5. Set the input and outputs as shown. The selection of the check boxes on each item creates theappropriate code to send data to the BSFN and return data back.

6. The wizard creates a new method based on your input above. It creates a call to the new methodon the line where you invoked the wizard to call an E1 BSFN. Verify the code looks the same asbelow adding code as necessary under the TODO reminder comments. Notice that we added codeto the BSFN call line so we can return messages from the call.

Page 33: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 33/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 33 

7. You will notice some red underlines indicating a compile issue. When the wizard that created thenew method calls the business function it specifies a generic InputVOType, see below. You needto fix this to use the actual value object class that is being used. In this case we need to replace

InputVOType with InternalGetABInfo.

8. At this point, everything should compile.

9. Fix any compile issues.

Test the Function. Finally!

1. Select the test class we created, GetABTestClass.2. Click on the Run button. You should see output that looks something like this:

Page 34: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 34/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 34 

3. You can test with other address book numbers by changing this line of code in the test class.

inputVo.setAddressNumber(new Integer (100110));

Check in the Business Service Functions

When checking the business service in, the developer has the opportunity to decide which artifacts shouldbe included in the check-in. The developer will also specify which class will be a published class. Only thespecified class will be built as a web service on the business services server.

1. Select JP550001 and click on the Check-In button.

2. The green check marks indicate which artifacts will be checked in. Clicking on the row header willcheck and uncheck the artifact. I always leave them all checked.

Page 35: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 35/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

Copyright © 2013 by Klee Associates, Inc. www.JDEtips.com  Page 35 

3. Select the class that you want to publish. Click on ABInfoTestPub.java.

4. Click on Row Exit Set Published. This will toggle identifying the class as published or not. It willthen display the selected class in the Published Class Name to confirm which one you selected.

5. Click on OK to complete the process and check-in the object.

6. Complete the same steps with J550001. However, you will not select a class to be published.

Scott Beebe has eighteen years of experience in software development, implementation, and

customization, including 14 years of JD Edwards OneWorld/EnterpriseOne Development. Experienceincludes software design and development, database design, and customizing andtroubleshooting of J.D. Edwards EnterpriseOne software. Additional J.D. Edwards experienceincludes post implementation support, system design and analysis, enhancements, conversions,modifications, retrofits, implementation, user support and training, technical troubleshooting,delivered portal components, developed JAVA components to plug into the portal, and systemsmanagement. Scott's website can be viewed here: http://jdetoolsplus.com/

Visit www.JDEtips.com for information on JDEtips University schedule, on-site training and consulting, andour Journal Document Library.

License Information: The use of JDE is granted to Klee Associates, Inc. by permission from J.D. Edwards World Source Company. Theinformation on this website and in our publications is the copyrighted work of Klee Associates, Inc. and is owned by Klee Associates, Inc.

Page 36: Bss v Wrapper for Function Beebe 852

7/23/2019 Bss v Wrapper for Function Beebe 852

http://slidepdf.com/reader/full/bss-v-wrapper-for-function-beebe-852 36/36

 

Creating a Business Services Wrapper for an

E1 Business Function 

NO WARRANTY: This documentation is delivered as is, and Klee Associates, Inc. makes no warranty as to its accuracy or use. Any use ofthis documentation is at the risk of the user. Although we make every good faith effort to ensure accuracy, this document may includetechnical or other inaccuracies or typographical errors. Klee Associates, Inc. reserves the right to make changes without prior notice.

NO AFFILIATION: Klee Associates, Inc. and this publication are not affiliated with or endorsed by J.D. Edwards & Company. J.D. Edwardssoftware referenced on this site is furnished under license agreements between J.D. Edwards & Company and their customers and can beused only within the terms of such agreements. J.D. Edwards is a registered trademark of J.D. Edwards & Company. JDE and OneWorld

are registered trademarks of J.D. Edwards World Source Company. WorldSoftware is a trademark of J.D. Edwards World SourceCompany. PeopleSoft,the PeopleSoft logo, PeopleTools, PS/inVision, PeopleCode, PeopleBooks, PeopleTalk, and Pure Internet Architecture are registered trademarks, and Intelligent Context Manager and The Real-Time Enterprise are trademarks of PeopleSoft, Inc.Oracle is a registered trademark of Oracle Corporation and/or its affiliates.

Klee Associates, Inc. is not affiliated with or endorsed by Oracle Corporation.