Select to view content in your preferred language

publishing a Geoprocessing service

809
2
11-24-2013 10:26 PM
VonDru
by
New Contributor
Hi there,

I've published a BufferPoints Geoprocessing service following the examples of ArcGIS Server .NET help  step by step. However, after I finished publishing the service, I didn't see the "Buffer Points" task below the geoprocessing service BufferService which was under the "localhost" GIS Server created by myself.

I tested the model before published the Geoprocessing service, it was OK. Then I called the BufferService in my own testing procedure. When I run the following code, I get this error message:
[RPC Fault faultString="Error Executing Task. Given keyword is not in the dictionary???" faultCode="500" faultDetail=""]

I'm a Flex newbie here,so any help will be appreciated. Thanks.

<?xml version="1.0" encoding="utf-8"?>
<s:Application    xmlns:fx="http://ns.adobe.com/mxml/2009"     
      xmlns:esri="http://www.esri.com/2008/ags"     
      xmlns:s="library://ns.adobe.com/flex/spark"     
      pageTitle="GP test with BufferService">
<fx:Script>     
  <![CDATA[  
   import com.esri.ags.FeatureSet;
   import com.esri.ags.Graphic;
   import com.esri.ags.events.MapMouseEvent;
   import com.esri.ags.geometry.MapPoint;
   import com.esri.ags.tasks.supportClasses.ExecuteResult;
   import com.esri.ags.tasks.supportClasses.LinearUnit;
   import com.esri.ags.tasks.supportClasses.ParameterValue;
  
   import mx.controls.Alert;
   import mx.rpc.AsyncResponder;       
  
   private var buffer_distance:LinearUnit = new LinearUnit();
 
  
   private function ComputePointArea(mapPoint:MapPoint):void
   {
    graphicsLayer.clear();   
    var graphic:Graphic = new Graphic(mapPoint, sms_circleAlphaSizeOutline);   
    graphicsLayer.add(graphic);   
    var featureSet:FeatureSet = new FeatureSet([ graphic ]);   
    buffer_distance.distance = 1000;
    buffer_distance.units = "esriMeters";
   
    var params:Object =
     {
      "Input Features": featureSet,
      "Distance": buffer_distance
     };
   
    gp.execute(params, new AsyncResponder(onResult, onFault));       
    function onResult(gpResult:ExecuteResult, token:Object = null):void
    {
     var pv:ParameterValue = gpResult.results[0];    
     var fs:FeatureSet = pv.value as FeatureSet;
     graphicsLayer.graphicProvider = fs.features;
    }
    function onFault(info:Object, token:Object = null):void
    {
     Alert.show(info.toString());
    }
   }
   private function mapClickHandler(event:MapMouseEvent):void          
   {
    var graphic:Graphic = new Graphic(event.mapPoint,sms_circleAlphaSizeOutline);
                                                   ComputePointArea(event.mapPoint); 
   }     
  ]]>    
</fx:Script>  

<fx:Declarations>
  <esri:SimpleMarkerSymbol id="sms_circleAlphaSizeOutline"
         alpha="0.5"
         size="5"
         style="circle"/>
  <esri:SimpleFillSymbol id="gFill"
          alpha="0.5"
          color="0x00FF00"/>
 
  <esri:UniqueValueRenderer id="uniqueValueRenderer" field="BUFF_DIST">
   <esri:UniqueValueInfo symbol="{gFill}" value="1000"/>
  </esri:UniqueValueRenderer> 
 
  <esri:Geoprocessor   id="gp"
       outSpatialReference="{myMap.spatialReference}"
       showBusyCursor="true"  url="http://localhost/arcgis/rest/services/BufferService/GPServer/BufferPoints"
        useAMF="false"/>
 
</fx:Declarations>

<esri:Map id="myMap" mapClick="mapClickHandler(event)" width="100%"  height="100%" >      
 
  <esri:ArcGISDynamicMapServiceLayer url="http://localhost/arcgis/rest/services/world_city/MapServer"/>  
  <esri:GraphicsLayer id="graphicsLayer" renderer="{uniqueValueRenderer}"/>
</esri:Map>

</s:Application>
Tags (2)
0 Kudos
2 Replies
AnthonyGiles
Honored Contributor
Von,

Are you using a the arcgis web adapter on your server, if not you will have to use the 6080 port number on your URLs, eg: http://localhost:6080/arcgis/rest/services

regards

Anthony
0 Kudos
VonDru
by
New Contributor
Von,

Are you using a the arcgis web adapter on your server, if not you will have to use the 6080 port number on your URLs, eg: http://localhost:6080/arcgis/rest/services

regards

Anthony



Anthony,


Thank you for your reply.But I'm afraid it's not the problem of arcgis web adapter.
I forgot to mention the develope environment of my program. I was using ArcGIS Server 10.0 and Flash Builder 4.6.
So what on earth is the problem?
I'm looking forward for your kindly answer.

regards

Von
0 Kudos