Connecting to the SOAP API Using Java and Axis 1.4

You can use the connection to the SOAP API to test your calls and perform various tasks, such as sending email and retrieving tracking information.

  1. Download Apache Axis 1.4.
  2. Follow the appropriate instructions at that site to install the service on your computer.
  3. Use the sample code below to authenticate your installation and exchange information with the SOAP API servers.

This sample code demonstrates how to use Java and Axis 1.4 to authenticate with the SOAP API.

Password Callback Handler

Place this sample code in the Class-path.file to define PasswordTokenHandler and what type of Password method the service is using. In this case, the service uses the PasswordText method.

The sample code below demonstrates how to define a callback handler.

The sample code below accesses the SOAP client and assigns the username and password in the request.

Content of Axis Client config.xml File

Changing the Default Call Timeout

Insert code shown in line 4 of the example below to change the length of the default timout on the call. Note that the call expresses the time in seconds.

Axis 1.4 encounters an error deserializing the response object as part of an Extract call. You can resolve this issue by moving to Axis2.

If you require the use of double-byte characters in your code, you must use Axis2 instead of Axis 1.4. Axis 1.4 does not correctly support double-byte characters and causes errors.