xpedition009

Arcgis server 10 to 10.1

Discussion created by xpedition009 on Jan 30, 2013
Latest reply on Jan 30, 2013 by rlwatson
How to connect to ArcGIS server using java API in ArcGIS Server 10.1.
Its working in 10.
Following code is the working code for ArcGIS Server 10.

ServerInitializer serverInitializer = null;
        ServerConnection connection = null;
        serverInitializer = new ServerInitializer();
        serverInitializer.initializeServer("domain", "username", "password");
        try {
            connection = new ServerConnection();
            connection.connect("host");
        } catch (AutomationException ae) {
            System.err.println("Caught AutomationException: " + ae.getMessage() + "\n");
            ae.printStackTrace();
        } catch (IOException e) {
            System.err.println("Caught IOException: " + e.getMessage() + "\n");
            e.printStackTrace();
        }

Outcomes