11 Understanding JD Edwards EnterpriseOne as a Web Service Consumer

This chapter contains the following topics:

Important:

Oracle reserves the right to reorganize the business services foundation packages (jar files) for tools release upgrades. If you are planning to upgrade your system, test your custom objects and modify them as appropriate to ensure your code will continue to work as intended. You cannot upgrade custom business service objects after you install a tools release upgrade.

11.1 JD Edwards EnterpriseOne as a Web Service Consumer

JD Edwards EnterpriseOne can call and process external web services. Being a native consumer of web service enables JD Edwards EnterpriseOne integration with other Oracle products and third-party systems. To enable JD Edwards EnterpriseOne integration with other systems, you create a business function that calls a business service. The business service calls an external web service. You also create a web service proxy that identifies where the web service can be found. The web service proxy contains any security information that must be passed in the web service call. Some web services do not require security. The results of the call are returned to the business service. The business service passes the results to the business function. This diagram illustrates JD Edwards EnterpriseOne as a web service consumer.

Figure 11-1 Process flow for JD Edwards EnterpriseOne as a web service consumer.

Description of Figure 11-1 follows
Description of ''Figure 11-1 Process flow for JD Edwards EnterpriseOne as a web service consumer.''

11.2 C Business Function Calling a Business Service

The C business function builds an XML document that contains required input and output parameters, and passes the XML document to an API that calls the business service. The XML document is based on the business service value object. Similarly, the return from the API includes an XML document with the results of the call.

11.2.1 Best Practices for Business Functions Calling Business Services

When a need for calling a web service from within JD Edwards EnterpriseOne occurs, a business function is required to make that call. To preserve changes that you have made to the JD Edwards EnterpriseOne business function when you upgrade or update your system, Oracle recommends that you create a new business function specifically for this task. This web service consumer business function can be called by a JD Edwards EnterpriseOne application or business function. Processing in this web service business function would include:

  • Initialize XML.

  • Build XML.

  • Call the API that calls the business service.

  • Map the response.

  • Handle errors.

  • Return to the calling business function.

11.3 Creating a Business Service for JD Edwards EnterpriseOne as a Web Service Consumer

To use JD Edwards EnterpriseOne as a web service consumer, you create a business service and its value object using methodology and tools discussed in preceding chapters of this guide and in the JD Edwards EnterpriseOne Tools Business Services Development Guide.

You can use the XML Template utility to create an empty XML document that is based on a business service value object. The XML Template utility is provided by JDeveloper and supports these data types:

  • java.lang.Integer

  • java.math.BigDecimal

  • oracle.e1.bssvfoudnation

  • util.MathNumeric

  • java.util.GregorianCalendar

  • java.util.Date

  • java.lang.Short

  • java.lang.Boolean

  • java.lang.String

11.3.1 Naming Convention for Consumer Business Services

For a business service that consumes third-party web services, the OMW object name is JC, system code, and zeros, where the zeros are a number that you assign; for example JC850001.

Note:

JCXXXXXX is used to distinguish between JD Edwards EnterpriseOne published business services (which are JPXXXXXX), internal business services (J0100003), and consumer business services. Some early consumer business services are named as J, system code, and XXXXX (for example, J8500001). These existing consumer business services will not be changed, only new consumer business services will include the JC preface.

11.3.2 Rules for Value Object for JD Edwards EnterpriseOne as a Web Service Consumer

A business service that is called from a business function must represent collections as arrays. You cannot use the ArrayList data type because it cannot be serialized. This code sample shows using an array for declaring the compound for phones:

private InternalPhone[] internalPhones = null;

11.4 Using Softcoding

Softcoding is a way to dynamically provide the where and who information to the web service proxy. The web service proxy needs to know exactly which machine to call for the service (the where), and it needs to know the credentials to pass for the call (the who). Also, values you use to test your business server in the development environment probably will be different from the actual values that are used in the production environment. Softcoding allows the where and who values to be plugged in at runtime instead of hard-coding these values into the business service.

A web service proxy has at least one softcoding template and one softcoding record; but a web service proxy can have many templates and many records. You can use softcoding templates to create softcoding records. Using a softcoding template is productive because softcoding records have similar values. Using a template also helps to minimize typing errors when you are entering record information.

11.4.1 Softcoding Template Naming Conventions

JD Edwards EnterpriseOne softcoding templates are named like this:

  • E1_J34A0010

  • E1_J34A0010A

E1 indicates that the template was created by JD Edwards EnterpriseOne developers at Oracle. J34A000, which is the key, is the business service name. The A indicates that a second template exists for the same business service.

To keep updates and upgrades simple, Oracle recommends that you not modify a JD Edwards EnterpriseOne softcoding template. Instead, you should copy the JD Edwards EnterpriseOne template, provide a new name, and make the appropriate modifications. For example, if you need to add security information to a template that has the correct right endpoint information, you can copy the existing template, rename it, and add the security information. You might name the new template similar to the JD Edwards EnterpriseOne template, for example:

CUST_J34A000

11.5 Testing the Business Service for JD Edwards EnterpriseOne as a Web Service Consumer

You test the business service in the development environment. You can test a business service that calls an external web service using one of these methods:

  • Create a test business service.

  • Use the development business services server.

Guidelines for using these methods are provided in Appendix B of the JD Edwards EnterpriseOne Tools Business Services Development Guide.