Reference - HTTP and Java Interface

This document covers the following topics:


Client Using the Java Interface

See also the delivered example XMMInvoker and XMLRPCService (EntireX XML/SOAP Runtime).

Step 1: Writing the Client Program

Start of instruction setTo write the client program

  1. Initialize the Broker Object:

    Broker broker = new Broker(brokerID, userID);
    // if a logon should be issued
     broker.logon(password);
  2. Initialize the XMLRPCService Object:

    XMLRPCService service;
    service = new XMLRPCService(xmmfilename);//constructor with XMM

    or

    XMLRPCService service;
    service = new XMLRPCService(broker, serverName, xmmfilename);
  3. Initialize the Conversation Object:

    For one XMLRPCService, only one conversation may be used at a time.

      private Conversation conv;
      conv = new Conversation(service);
  4. Assign the incoming XML document:

    String xmlDocument = "<?xml version="1.0" encoding="iso8859-1"?>" +
    "<CALC Operation=\"-\" Operand_1=\"1000000611\"
    Operand_2=\"1000000288\"></CALC>";
  5. Invoke the Service.

    Non-conversational:

    try
    {
      String result = service.invokeXML(xmlDocument);
    }
    catch (XMLException e)
    {
       // Error handling ...
    }
    catch (BrokerException e)
    {
      // Error handling ...
    }
    catch (Exception e)
    {
      // Error handling ...
    }

    Conversational:

    try
    {
      service.setConversation(conv);
      String result = service.invokeXML(xmlFromFile(filename));
      service.closeConversationCommit();
    }
    catch (XMLException e)
    {
       // Error handling ...
    }
    catch (BrokerException e)
    {
      // Error handling ...
    }
    catch (Exception e)
    {
      // Error handling ...
    }

    The string result contains the returned document. It should be:

    <CALC Function_result="899" />

Step 2: Running the Client Program

The definition of the Java classpath must include

  • the generated XMM file, see Generating an XMM File

  • the entirex.jar file (delivered in the directory <EntireX Home>/classes)

  • the files for an XMLStreamParser, for example the delivered wstx-asl.jar and stax-api.jar (in the directory <EntireX Home>/classes)

The Java Interface

Class XMLRPCService

XMLRPCService extends com.softwareag.entirex.aci.RPCService. See XMLRPCService (EntireX XML/SOAP Runtime).

The HTTP Interface

The Listener for XML/SOAP supports HTTP POST Request and HTTP GET Request. The following HTTP headers and parameters are available. Use them from the EntireX XML Tester or other third-party XML tools:

Header/Parameter Direction Description
exx-brokerID IN If this attribute is set, it overwrites both the properties of the XMM file and the settings of the servlet initialization.
exx-service IN The service name is the triplet of server class/server name/service. If this attribute is set, it overwrites both the properties of the XMM file and the settings of the servlet initialization.
exx-userID IN The user ID specified here is used for calling the broker.
exx-password IN The password specified here is used for calling the broker.
exx-use-security IN Deprecated. An internal automatic routine makes this parameter obsolete. Possible values: true | false.
exx-rpc-userID IN The RPC user ID specified here is used for Natural Security. If no RPC user ID and no RPC password is defined, the values of exx-userID and exx-password are used for these values.
exx-rpc-password IN The RPC password specified here is used for Natural Security. If no RPC user ID and no RPC password is defined, the values of exx-userID and exx-password are used for these values.
exx-natural-security IN Possible values: true | false. Determines whether Natural Security is used. See Using the Broker and RPC User ID/Password.
exx-natural-library IN The Natural library. Applicable only if exx-natural-security is "true". See Using the Broker and RPC User ID/Password.
exx-use-codepage IN Determines the encoding the Listener for XML/SOAP uses to communicate with EntireX Broker. See RPC Call (Broker Request) in the Listener for XML/SOAP documentation.
exx-compresslevel IN Sets the compression level. See Using Compression under Writing Advanced Applications - EntireX Java ACI.
exx-compression IN Possible values: true |false. See Using Compression.
exx-xml-sessionID IN OUT This HTTP header is returned from the servlet to the client application. If the client returns it to the servlet with the preceding call, the same session will be used. For conversations, the exx-conv parameter is also required.
exx-xml-info OUT In this HTTP header additional information is returned.
exx-xml-error OUT In this HTTP header error information is returned.
exx-conv IN Possible values: OPEN | COMMIT | BACKOUT.

Conversations can only be used in connection with sessions. If the session is interrupted, the conversation is deleted.

exx-reliable IN Possible values: AUTO-COMMIT | OFF.

See Reliable RPC for XML/SOAP Wrapper.