arcgissamples\soe\soapclient\JavaSimpleSOAPSOEClient.java—ArcObjects 10.4 Help for Java | ArcGIS for Desktop
Simple SOAP SOE Sample
arcgissamples\soe\soapclient\JavaSimpleSOAPSOEClient.java
/* Copyright 2015 ESRI
* 
* All rights reserved under the copyright laws of the United States
* and applicable international laws, treaties, and conventions.
* 
* You may freely redistribute and use this sample code, with or
* without modification, provided you include the original copyright
* notice and use restrictions.
* 
* See the use restrictions at <your ArcGIS install location>/DeveloperKit10.4/userestrictions.txt.
* 
*/
package arcgissamples.soe.soapclient;

import arcgissamples.soe.JavaSimpleSOAPSOEServiceBindingStub;

public class JavaSimpleSOAPSOEClient {
    public static void main(String[] args) {
  if (args.length != 2) {
      System.out
        .println("Correct usage is: JavaSimpleSOAPSOEClient <name of server> <name of map service>");
  } else {
      String serverName = args[0];
      String serviceName = args[1];

      String url = "http://" + serverName + ":6080/arcgis/services/"
        + serviceName + "/MapServer/JavaSimpleSOAPSOE";
      JavaSimpleSOAPSOEServiceBindingStub stub = new JavaSimpleSOAPSOEServiceBindingStub(
        url);
      stub.enableRequestResponseLogging(true);

      /*System.out.println("Number of Feature Layers in map service: "
        + stub.getLayerCountByType("feature"));
      System.out.println("Number of Raster Layers in map service: "
        + stub.getLayerCountByType("raster"));
      System.out.println("Number of dataset layers in map service: "
        + stub.getLayerCountByType("datasets"));*/
      System.out.println("Total number of layers in map service: "
        + stub.getLayerCountByType("all"));
  }
    }
}