Real Time Information Director User Documentation

RTID Message Format and Programmatic Interfaces
Hewlett-Packard Company 11 529618 - 002
A query, if the client sent a new or updated document. (The client can use this
query later, to retrieve the document just loaded.)
An error response, if the request could not be completed successfully
In addition to these interfaces for submitting and retrieving documents, the Director
supports a management interface for setting configuration and operational parameters,
loading metadata dynamically, and monitoring Director operations. That interface is
described in the document entitled RTID Management.
Invoking the Dispatch Servlet, Using HTTP
To invoke the Dispatch servlet from a client program, you need:
The URL of the Dispatch servlet
An interface that allows you to open a connection to a URL, and to post and
retrieve files (in this case, XML documents)
You assign the URL of the Dispatch servlet when you deploy the Director. Under
WebLogic 7.1, the URL is specified in the properties file (named zli.properties by
default). Under WebLogic 8.0, the URL is specified in the web.xml file. For details
about Director deployment, see the document entitled RTID Deployment.
To invoke the Dispatch servlet from a program written in Java, you use various methods
defined for the classes in the java.io package and, notably, several methods defined for
the classes java.net.URL and java.net.HttpURLConnection. Although the specifics of
processing will vary with the client, a common outline of steps is as follows:
1. Obtain the servlet URL, possibly from the command line:
urlString = args[++i]
2. Construct the URL by concatenating http:// with the specified URL string:
url = newURL (“http://” + urlstring);
3. Use the openConnection method of the URL object to establish a connection:
urlConn = (HttpURLConnection)url.openConnection;
4. Use set methods of the HttpURLConnection to set properties of the connection
and request. The Content-Type must be text/html:
urlConn.setDoInput(true);
urlConn.setDoOutput(true);
urlConn.setUseCaches(false);
urlConn.setRequestProperty("Content-Type","text/html");