Package com.esri.arcgisws

Examples of com.esri.arcgisws.MapServerBindingStub


   * @throws Exception if an exception occurs
   */
  @Override
  public void collectMetadata(ServiceHandlerFactory handlerFactory, ServiceInfo serviceInfo)
    throws Exception {
    MapServerBindingStub stub =
      getCredentials()==null || getCredentials().getUsername().length()==0 || getCredentials().getPassword().length()==0?
      new MapServerBindingStub(serviceInfo.getSoapUrl()):
      new MapServerBindingStub(serviceInfo.getSoapUrl(), getCredentials().getUsername(), getCredentials().getPassword());
    serviceInfo.getKeywords().add(serviceInfo.getType());
    serviceInfo.addKeywords("liveData,service",",");
   
    MapServerInfo mapInfo = stub.getServerInfo(stub.getDefaultMapName());
   
    //serviceInfo.setName(mapInfo.getName());
    serviceInfo.setDescription(mapInfo.getDescription());
    serviceInfo.setEnvelope(mapInfo.getFullExtent());
    //serviceInfo.setEnvelope(mapInfo.getExtent());
   
    /*
    System.err.println("nm="+mapInfo.getDefaultMapDescription().getName());
    System.err.println("ld="+mapInfo.getDefaultMapDescription().getLayerDescriptions());
    System.err.println("     getDefaultMapName()="+service.getDefaultMapName());
    System.err.println("     getCopyrightText()="+mapinfo.getCopyrightText());
    System.err.println("     getMapLayerInfos()="+mapinfo.getMapLayerInfos());
    System.err.println("     getSpatialReference()="+mapinfo.getSpatialReference());
    System.err.println("     getDefaultMapDescription()="+mapinfo.getDefaultMapDescription());
     */
   
    // thumbnail
    String thumbnailUrl = Val.chkStr(serviceInfo.getRestUrl());
    if (thumbnailUrl.length() > 0) {
      if (!thumbnailUrl.endsWith("/MapServer")) {
        int idx = thumbnailUrl.lastIndexOf("/MapServer/");
        if (idx != -1) {
          thumbnailUrl = thumbnailUrl.substring(0,idx+10);
        }
      }
      if (thumbnailUrl.endsWith("/MapServer")) {
        serviceInfo.setThumbnailUrl(thumbnailUrl+"/export?size=256,256&f=image");
      }
    }
   
   
   
    // MXD properties
    PropertySet docInfo = stub.getDocumentInfo();
    if (docInfo != null) {
      PropertySetProperty[] psps = docInfo.getPropertyArray();
      if (psps != null) {
        for (PropertySetProperty psp: psps) {
          String key = Val.chkStr(psp.getKey());
View Full Code Here


  @Override
  public ServiceInfo createServiceInfo(ServiceInfo parentInfo, ServiceDescription desc, String currentRestUrl, String currentSoapUrl) {
    ServiceInfo serviceInfo = super.createServiceInfo(parentInfo, desc, currentRestUrl, currentSoapUrl);
    try {
      MapServerBindingStub stub =
        getCredentials()==null || getCredentials().getUsername().length()==0 || getCredentials().getPassword().length()==0?
        new MapServerBindingStub(serviceInfo.getSoapUrl()):
        new MapServerBindingStub(serviceInfo.getSoapUrl(), getCredentials().getUsername(), getCredentials().getPassword());
      MapServerInfo mapInfo = stub.getServerInfo(stub.getDefaultMapName());
      serviceInfo.setEnvelope(mapInfo.getFullExtent());
     
      MapLayerInfo[] mapLayerInfos = mapInfo.getMapLayerInfos();
      for (MapLayerInfo li: mapLayerInfos) {
        if (!li.isIsFeatureLayer()) continue;
View Full Code Here

TOP

Related Classes of com.esri.arcgisws.MapServerBindingStub

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.