12 Using Business Services with HTTP Request/Reply

This chapter contains the following topics:

12.1 Understanding Business Services and HTTP POST

JD Edwards EnterpriseOne enables you to use a business service to communicate with a third-party system using HTTP POST. In this scenario, a business function is invoked by a request from a JD Edwards EnterpriseOne HTML web client, which in turn calls a business service to make an HTTP POST request. You provide callback information in the posted data for the third-party system to send an asynchronous reply to the request. When the callback reply is received from the third-party system, the published business service that was included in the callback information is invoked. The response is returned to the JD Edwards EnterpriseOne HTML web client.

The business services server uses a servlet listener to receive incoming messages from third-party systems. Received messages contain callback information, which is used to associate the message with the correct request.

See Also:

12.2 Using Business Services with HTTP Request/Reply

When you use business services to do an HTTP request/reply, follow these rules:

  • The listener servlet checks for authorization before calling the published business service. Therefore, you must have authorization to invoke the specified method on the published business service.

  • The value object class of the method to be called must have only one string field and the accessor (getter/setter) method for the string field. The received XML payload will be passed to the method in this string field.

  • The method to be called must have three parameters. This code sample shows the signature for this method:

    public responseVO methodToBeCalled((IContext context, IConnection 
    connection,requestVO vo)
    

    Note:

    This method must have a public modifier. The wizard that you use to create the structure for a published business service generates a method with a protected modifier. You must change the method from protected to public so that the published business service can be called from the listener service.
  • The listener servlet does not wait for a response from the business service call. Any response is ignored.

  • This kind of published business service must be used as the bridge between getting a response from external sites and calling the processor business service that does the business logic.

12.3 Testing the Servlet

You should test the servlet to ensure that it receives the return messages. You can do this by creating an XML document that has the HTTP URL in it and ensuring that the message is delivered to the URL.