Getting Started with Apache Axis

You can use Apache Axis2/Java to implement a client application that uses the Luminate Online Web Services. This topic outlines the process.

  1. Install a Java Development Kit, version 5 or newer. You should be able to execute javac -version from a shell or command prompt.
  2. Install Apache Axis2, and Apache Ant. You should be able to execute ant -version and WSDL2Java from a shell or command prompt.
  3. Execute the following to generate the client databindings using ADB. (Replace SITE with your site shortname, and ensure you have the correct cluster.) WSDL2Java -uri http://webservices.cluster[2 or 3].convio.net/1.0/SITE/wsdl -p com.convio.webservice.client -d adb -ss -g -uw -s
  4. Copy the following test program into src/com/convio/webservice/client/DataSyncClient.java, changing SITE, cluster, myapiuser, and myapipassword to reflect your actual settings.
    package com.convio.webservice.client;
    
    import com.convio.soap.*; 
    import com.convio.webservice.client.*;
    
    public class DataSyncClient { 
        public static void main(String[] args) throws Exception { 
            String endpointUrl = "http://webservices.cluster[2 or 3].convio.net/1.0/SITE";
            ConvioServiceStub stub = new ConvioServiceStub(endpointUrl);
    
            System.out.println("Connecting to " + endpointUrl);
    
            LoginResult loginRes = stub.Login("myapiuser", "myapipassword");
    
            System.out.println("Login successful: " + loginRes.getSessionId()); 
        } 
    }
          
  5. Build the client by typing ant jar.client .
  6. Run the client by typing axis2 -cp build\lib\ConvioService-test-client.jar com.convio.webservice.client.DataSyncClient .

Comments

Submitted by Stephen Richarme at 11:46 AM on January 28, 2013
Note: These instructions assume Axis2 version 1.4.1 - the more recent Axis2 version 1.5.6 will require some changes to the referenced code, including calling the "login" method (all lowercase letters) instead of the "Login" method. In addition, the following line of code can be used to disable "chunking" support: stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); For more details on this, read the following: http://axis.apache.org/axis2/java/core/docs/http-transport.html

Leave a Comment

Nickname
Comment
Enter this word: