Working with Java Sample Code

XmlTransmitter.zip contains completed source code which handles reading the XML request file, sending the request to UPS Online Tool server, and writing the XML response to a file. Within the XmlTransmitter zip file are an IBM and Sun version both of which require xmlsample.jar to be added to the client machine's classpath. The IBM version, XmlTransmitterIBM.java, uses SSLite along with Java (To download JDK/JRE 1.1.6 or greater, go to http://java.sun.com/products/jdk/1.1/index.html) . In order for the sample code to function, the file sslite.zip must be added to the client machine's classpath. The file KeyRing.pfx must be used with the SSLite/IBM implementation. The XmlTransmitterSUN.java file requires Sun's Java Secure Socket Extension 1.0.2 (JSSE) which can be download at http://java.sun.com/products/jsse/.  It is recommended that you follow the examples provided by your particular SSL package when implementing that respective code.

 

If you already have the XML files of Access Request (see the Access Request sample) and Service Request(see the Service Request sample), and you want to have the XML response write to a file (see the Service Response sample), you can run:

 

XmlTransmitter <service>  <configuration filename>  <AccessRequest filename>  <ServiceRequest Filename>  <xml response filename>.

 

The configuration file sets the server's host name, connection protocol, location of the file KeyRing.pfx, and proxy server properties. A sample configuration file is here. Please modify the values based on your environment.

 

To quickly view the result of sending Tracking Request to XML OnLine tool server, run the batch file testXmlTransmitterIBM.bat or testXmlTransmitterSUN.bat (Be sure the path of the java executable is in your system path).

 

 

Return to Top

 

Copyright � 2006 United Parcel Service of America, Inc.