当前位置:编程学习 > JAVA >>

swing程序访问arcGisServer

package gisServer;

import com.esri.arcgisws.EsriUnits;
import com.esri.arcgisws.MapServerBindingStub;
import com.esri.arcgisws.PointN;


public class HelloWorldClient{
        public static void main(String[] args) {
                String wsService = "http://pc-201107111431:8399/arcgis/rest/services/WGS84-GEOGRAPHIC/MapServer";
//                MapServerBindingStub mapservice = new MapServerBindingStub(new java.net.URL(wsService), null);
                MapServerBindingStub mapservice = new MapServerBindingStub(wsService,"arcgismanager","123");                String mapname = mapservice.getDefaultMapName();
                PointN pnt0 = new PointN();
                pnt0.setX(-120.0);
                pnt0.setY(30.0);
                PointN pnt1 = new PointN();
                pnt1.setX(-110.0);
                pnt1.setY(35.0);
                double distance = mapservice.computeDistance(mapname, pnt0, pnt1, EsriUnits.esriMiles);

        }

}
我要怎么才能运行这段代码? --------------------编程问答--------------------
自己顶! --------------------编程问答-------------------- 右键 run as -> java application
补充:Java ,  Java SE
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,