Select to view content in your preferred language

GP SDK EXAMPLE - ENHANCEMENT

3266
12
12-02-2010 06:44 AM
ChristineZeller
Occasional Contributor
Good Morning,

I am working through getting a Geoprocess Task up and running.  Currently, I am working with SDK example: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ClipFeatures

I noticed that the task http://serverapps.esri.com/ArcGIS/rest/services/SamplesNET/USA_Data_ClipTools/GPServer/ClipCounties
has the capabilities to generate an output parameter: output.zip file. 

Basically, I wanted to take the current example from the SDK and just enhance it to the point where the output.zip file is delivered to the client. 

I�??m having some trouble and I�??m wondering if someone has already taken this process/sdk example and enhanced it this way.  Could/would you share some pointers/suggestions/code?

Thanks
Christine.
0 Kudos
12 Replies
nakulmanocha
Esri Regular Contributor
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
using ESRI.ArcGIS.Client;
using ESRI.ArcGIS.Client.Tasks;

namespace ArcGISSilverlightSDK
{
    public partial class ClipFeatures : UserControl
    {
        private DispatcherTimer _processingTimer;
        private Draw MyDrawObject;

        public ClipFeatures()
        {
            InitializeComponent();

            _processingTimer = new System.Windows.Threading.DispatcherTimer();
            _processingTimer.Interval = new TimeSpan(0, 0, 0, 0, 800);
            _processingTimer.Tick += ProcessingTimer_Tick;

            MyDrawObject = new Draw(MyMap)
            {
                DrawMode = DrawMode.Polyline,
                IsEnabled = true,
                LineSymbol = LayoutRoot.Resources["ClipLineSymbol"] as ESRI.ArcGIS.Client.Symbols.LineSymbol
            };
            MyDrawObject.DrawComplete += MyDrawObject_DrawComplete;
        }

        private void MyDrawObject_DrawComplete(object sender, DrawEventArgs args)
        {
            MyDrawObject.IsEnabled = false;

            ProcessingTextBlock.Visibility = Visibility.Visible;
            _processingTimer.Start();

            GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;

            Graphic graphic = new Graphic()
            {
                Symbol = LayoutRoot.Resources["ClipLineSymbol"] as ESRI.ArcGIS.Client.Symbols.LineSymbol,
                Geometry = args.Geometry
            };
            graphicsLayer.Graphics.Add(graphic);

            Geoprocessor geoprocessorTask = new Geoprocessor("http://serverapps.esri.com/ArcGIS/rest/services/" +
                "SamplesNET/USA_Data_ClipTools/GPServer/ClipCounties");
            geoprocessorTask.UpdateDelay = 5000;
             
            geoprocessorTask.JobCompleted += GeoprocessorTask_JobCompleted;

            List<GPParameter> parameters = new List<GPParameter>();
            parameters.Add(new GPFeatureRecordSetLayer("Input_Features", args.Geometry));
            parameters.Add(new GPLinearUnit("Linear_unit", esriUnits.esriMiles, Int32.Parse(DistanceTextBox.Text)));
            
            geoprocessorTask.SubmitJobAsync(parameters);
        }

        private void GeoprocessorTask_JobCompleted(object sender, JobInfoEventArgs e)
        {
            
            Geoprocessor geoprocessorTask = sender as Geoprocessor;
            

             

            geoprocessorTask.GetResultDataCompleted += (s1, ev1) =>
            {
                
                GraphicsLayer graphicsLayer = MyMap.Layers["MyResultGraphicsLayer"] as GraphicsLayer;

               
                //if (ev1.Parameter is GPFeatureRecordSetLayer)
                //{
                //    GPFeatureRecordSetLayer gpLayer = ev1.Parameter as GPFeatureRecordSetLayer;
                    
                //    if (gpLayer.FeatureSet.Features.Count == 0)
                //    {
                //        geoprocessorTask.GetResultImageLayerCompleted += (s2, ev2) =>
                //        {
                //            GPResultImageLayer gpImageLayer = ev2.GPResultImageLayer;
                //            gpImageLayer.Opacity = 0.5;
                //            MyMap.Layers.Add(gpImageLayer);

                //            ProcessingTextBlock.Text = "Greater than 500 features returned.  Results drawn using map service.";
                //            _processingTimer.Stop();
                //        };
                        

                //        geoprocessorTask.GetResultImageLayerAsync(e.JobInfo.JobId, "Clipped_Counties");
                //        return;
                //    }
                    

                //    foreach (Graphic graphic in gpLayer.FeatureSet.Features)
                //    {
                //        graphic.Symbol = LayoutRoot.Resources["ClipFeaturesFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
                //        graphicsLayer.Graphics.Add(graphic);
                //    }
                //}

                if (ev1.Parameter is GPDataFile)
                {
                    GPDataFile gpdata = ev1.Parameter as GPDataFile;
                    Uri uri = new Uri(gpdata.Url);
                    
                    System.Windows.Browser.HtmlPage.Window.Navigate(uri);
                }

                ProcessingTextBlock.Visibility = Visibility.Collapsed;
                _processingTimer.Stop();
            };
            
            //geoprocessorTask.GetResultDataAsync(e.JobInfo.JobId, "Clipped_Counties");
            geoprocessorTask.GetResultDataAsync(e.JobInfo.JobId, "output_zip");
        }

        

        private void GeoprocessorTask_Failed(object sender, TaskFailedEventArgs e)
        {
            MessageBox.Show("Geoprocessor service failed: " + e.Error);
        }

        private void ClearButton_Click(object sender, RoutedEventArgs e)
        {
            List<Layer> gpResultImageLayers = new List<Layer>();

            foreach (Layer layer in MyMap.Layers)
                if (layer is GraphicsLayer)
                    (layer as GraphicsLayer).ClearGraphics();
                else if (layer is GPResultImageLayer)
                    gpResultImageLayers.Add(layer);
            for (int i = 0; i < gpResultImageLayers.Count; i++)
                MyMap.Layers.Remove(gpResultImageLayers);

            MyDrawObject.IsEnabled = true;

            ProcessingTextBlock.Text = "";
            ProcessingTextBlock.Visibility = Visibility.Collapsed;
        }

        void ProcessingTimer_Tick(object sender, EventArgs e)
        {
            if (ProcessingTextBlock.Text.Length > 20 || !ProcessingTextBlock.Text.StartsWith("Processing"))
                ProcessingTextBlock.Text = "Processing.";
            else
                ProcessingTextBlock.Text = ProcessingTextBlock.Text + ".";
        }
    }
}
0 Kudos
ChristineZeller
Occasional Contributor
Nakul,

Thanks for the response!  I really appreciate the help.  I got your code up and running and the zip file is now being delieved to me, which is very cool.

I've been working on this for a few days and was hoping I could ask another question or two:o

I got you sample/code up and running and it works great! THANKS! I was trying to tweak it to make both output paramters return (the clipped counties and the zip file) but I was having trouble.  Also I was wondering if there is a way to return the zip as a hyperlink instead of the instant download splash?

Basically, I thought if I got this sample up and rolling I would have a solid example to help me get my own model up and going, which is doing something similar.  My model task the user input (a drawn line) and select a feature layer (parcel layer) and then does a buffer around the selected set. It then does some simple calculations, clips, adds, deletes and creates a few excel files that are zipped and it adds this same calculated tables to a html file so the user can eiter view the report in Xcel or in a HTML file. 


my model has the following

Input parameters:

Buffer Distance - Data Type: GPLinearUnit
User Drawn Graphic PolyLine - Data Type: GPFeatureRecordSetLayer
Title for a html page - Data Type: GPString

Output Parameters:

BufferedParcels -  GPFeatureRecordSetLayer
Output Zip file - Data Type: GPDataFile
Output HTML file - Data Type: GPDataFile


So basically if I can get your previous code outputting both parameters shouldn't I be able to add the thrid output (HTML FILE), flip out the clipped counties with the buffered parcels and add a input parameter for the html title and be up and going?

Thanks for all your time and help, I appreciate it.

Christine.
0 Kudos
nakulmanocha
Esri Regular Contributor
For returning a hyperlink instead of download splash you may use hyperlink button

Here are code changes in the code xaml file and the code behind

<Grid HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="0,15,15,0" >
            <HyperlinkButton x:Name="button1" Visibility="Collapsed" Height="19" Width="auto"  Foreground="Black" />
        </Grid>



if (ev1.Parameter is GPDataFile)
                {
                    GPDataFile gpdata = ev1.Parameter as GPDataFile;
                    Uri uri = new Uri(gpdata.Url);
                    button1.NavigateUri = uri;
                    button1.Content = uri;
                    button1.Visibility = System.Windows.Visibility.Visible;
                    //System.Windows.Browser.HtmlPage.Window.Navigate(uri);
                }
0 Kudos
ChristineZeller
Occasional Contributor
Thanks again Nakul,

I will give your code a shot and see if I can return the hyperlink.

One more question: Can you tell me how to return both parameters (Clipped Counties and the ZIP)

I tried to uncomment out the code you commented out but no luck.


geoprocessorTask.GetResultDataAsync(e.JobInfo.JobId, "Clipped_Counties");
            geoprocessorTask.GetResultDataAsync(e.JobInfo.JobId, "output_zip");
0 Kudos
JackCibor
Frequent Contributor
I am also trying to figure out how to return multiple output parameters from the same Async GP Task Job. Does anyone have any C# code examples for how you do that.
0 Kudos
nakulmanocha
Esri Regular Contributor
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
using ESRI.ArcGIS.Client;
using ESRI.ArcGIS.Client.Tasks;

namespace ArcGISSilverlightSDK
{
    public partial class ClipFeatures : UserControl
    {
        private DispatcherTimer _processingTimer;
        private Draw MyDrawObject;

        public ClipFeatures()
        {
            InitializeComponent();

            _processingTimer = new System.Windows.Threading.DispatcherTimer();
            _processingTimer.Interval = new TimeSpan(0, 0, 0, 0, 800);
            _processingTimer.Tick += ProcessingTimer_Tick;

            MyDrawObject = new Draw(MyMap)
            {
                DrawMode = DrawMode.Polyline,
                IsEnabled = true,
                LineSymbol = LayoutRoot.Resources["ClipLineSymbol"] as ESRI.ArcGIS.Client.Symbols.LineSymbol
            };
            MyDrawObject.DrawComplete += MyDrawObject_DrawComplete;
        }

        private void MyDrawObject_DrawComplete(object sender, DrawEventArgs args)
        {
            MyDrawObject.IsEnabled = false;

            ProcessingTextBlock.Visibility = Visibility.Visible;
            _processingTimer.Start();

            GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;

            Graphic graphic = new Graphic()
            {
                Symbol = LayoutRoot.Resources["ClipLineSymbol"] as ESRI.ArcGIS.Client.Symbols.LineSymbol,
                Geometry = args.Geometry
            };
            graphicsLayer.Graphics.Add(graphic);

            Geoprocessor geoprocessorTask = new Geoprocessor("http://serverapps.esri.com/ArcGIS/rest/services/" +
                "SamplesNET/USA_Data_ClipTools/GPServer/ClipCounties");
            geoprocessorTask.UpdateDelay = 5000;
             
            geoprocessorTask.JobCompleted += GeoprocessorTask_JobCompleted;

            List<GPParameter> parameters = new List<GPParameter>();
            parameters.Add(new GPFeatureRecordSetLayer("Input_Features", args.Geometry));
            parameters.Add(new GPLinearUnit("Linear_unit", esriUnits.esriMiles, Int32.Parse(DistanceTextBox.Text)));
            
            geoprocessorTask.SubmitJobAsync(parameters);
        }

        private void GeoprocessorTask_JobCompleted(object sender, JobInfoEventArgs e)
        {
            
            Geoprocessor geoprocessorTask = sender as Geoprocessor;
            

             

            geoprocessorTask.GetResultDataCompleted += (s1, ev1) =>
            {
                
                GraphicsLayer graphicsLayer = MyMap.Layers["MyResultGraphicsLayer"] as GraphicsLayer;


                if (ev1.Parameter is GPFeatureRecordSetLayer)
                {
                    GPFeatureRecordSetLayer gpLayer = ev1.Parameter as GPFeatureRecordSetLayer;

                    if (gpLayer.FeatureSet.Features.Count == 0)
                    {
                        geoprocessorTask.GetResultImageLayerCompleted += (s2, ev2) =>
                        {
                            GPResultImageLayer gpImageLayer = ev2.GPResultImageLayer;
                            gpImageLayer.Opacity = 0.5;
                            MyMap.Layers.Add(gpImageLayer);

                            ProcessingTextBlock.Text = "Greater than 500 features returned.  Results drawn using map service.";
                            _processingTimer.Stop();
                        };


                        geoprocessorTask.GetResultImageLayerAsync(e.JobInfo.JobId, "Clipped_Counties");
                        return;
                    }


                    foreach (Graphic graphic in gpLayer.FeatureSet.Features)
                    {
                        graphic.Symbol = LayoutRoot.Resources["ClipFeaturesFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
                        graphicsLayer.Graphics.Add(graphic);
                    }
                }

                if (ev1.Parameter is GPDataFile)
                {
                    GPDataFile gpdata = ev1.Parameter as GPDataFile;
                    Uri uri = new Uri(gpdata.Url);
                    button1.NavigateUri = uri;
                    button1.Content = uri;
                    button1.Visibility = System.Windows.Visibility.Visible;
                    //System.Windows.Browser.HtmlPage.Window.Navigate(uri);
                    geoprocessorTask.GetResultDataAsync(e.JobInfo.JobId, "Clipped_Counties");
                }

                ProcessingTextBlock.Visibility = Visibility.Collapsed;
                _processingTimer.Stop();
            };
            
            //geoprocessorTask.GetResultDataAsync(e.JobInfo.JobId, "Clipped_Counties");
            geoprocessorTask.GetResultDataAsync(e.JobInfo.JobId, "output_zip");
            
        }

        

        private void GeoprocessorTask_Failed(object sender, TaskFailedEventArgs e)
        {
            MessageBox.Show("Geoprocessor service failed: " + e.Error);
        }

        private void ClearButton_Click(object sender, RoutedEventArgs e)
        {
            List<Layer> gpResultImageLayers = new List<Layer>();

            foreach (Layer layer in MyMap.Layers)
                if (layer is GraphicsLayer)
                    (layer as GraphicsLayer).ClearGraphics();
                else if (layer is GPResultImageLayer)
                    gpResultImageLayers.Add(layer);
            for (int i = 0; i < gpResultImageLayers.Count; i++)
                MyMap.Layers.Remove(gpResultImageLayers);

            MyDrawObject.IsEnabled = true;

            ProcessingTextBlock.Text = "";
            ProcessingTextBlock.Visibility = Visibility.Collapsed;
        }

        void ProcessingTimer_Tick(object sender, EventArgs e)
        {
            if (ProcessingTextBlock.Text.Length > 20 || !ProcessingTextBlock.Text.StartsWith("Processing"))
                ProcessingTextBlock.Text = "Processing.";
            else
                ProcessingTextBlock.Text = ProcessingTextBlock.Text + ".";
        }
    }
}
0 Kudos
ChristineZeller
Occasional Contributor
Nakul,

Thanks again for all your posts!  I was able to get your code and the sample up and running...very cool.

I was hoping you or someone might be able to take a look at what I have and shed some light on what I'm doing wrong.  My process just runs and runs; it never stops and/or never sends an error or results.  The only thing I'm really doing different is my polyline is selecting a Parcel layer and then creating a buffer distance which is in Feet not Miles (the SDK example is in Miles).  Also, I don't have map extent set in my xaml.  I guess the other thing that might be causing the problem is my mxds are in 102100 projection and my model/geotask: the geopolyline input parameter is in spatial ref 4269 and my BufferedParcels Output parameter is in spatial ref 2230. BUT it works in a straight out the box Server app (.NET API 9.3.1).


Here's my XAML


<UserControl x:Class="GeoProcessTest.MainPage"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:esri="http://schemas.esri.com/arcgis/client/2009">

    <Grid x:Name="LayoutRoot" Background="White">

        <Grid.Resources>
            <esri:SimpleLineSymbol x:Key="ClipLineSymbol" Color="Red" Width="2" />
            <esri:SimpleFillSymbol x:Key="ClipFeaturesFillSymbol" Fill="#770000FF" BorderBrush="#FF0000FF" BorderThickness="1" />
        </Grid.Resources>

        <esri:Map x:Name="MyMap" Background="White" >
            <esri:ArcGISDynamicMapServiceLayer ID="StreetMapLayer" 
                    Url="http://GISserver/ArcGIS/rest/services/GeoProcessTestSilver/MapServer"/>
            <esri:GraphicsLayer ID="MyResultGraphicsLayer" >
                <esri:GraphicsLayer.MapTip>
                    <Grid Background="LightYellow">
                        <StackPanel Orientation="Horizontal" Margin="5">
                            <TextBlock Text="Ownership: " FontWeight="Bold" />
                            <TextBlock Text="{Binding [APN]}" />
                        </StackPanel>
                        <Border BorderBrush="Black" BorderThickness="1" />
                    </Grid>
                </esri:GraphicsLayer.MapTip>
            </esri:GraphicsLayer>
            <esri:GraphicsLayer ID="MyGraphicsLayer" />
        </esri:Map>

        <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,15,15,0" >
            <Rectangle Fill="#77919191" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5" >
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Rectangle Fill="#FFFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10" />
            <StackPanel Orientation="Vertical" Margin="10" HorizontalAlignment="Left" >
                <TextBlock Text="Clip polygon features - Public Lands" HorizontalAlignment="Center" FontWeight="Bold" 
                           Margin="5"/>
                <TextBlock x:Name="InformationTextBlock" Text="Draw a line on the map over the Dido. When finished the line will be buffered and the buffer will be used to clip US county polygons. Results are returned as a GP map image."
                    Width="200" TextAlignment="Left" TextWrapping="Wrap" />
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="5">
                    <TextBlock Text="Distance (in miles): " VerticalAlignment="Center" />
                    <TextBox x:Name="DistanceTextBox" Text="1" Width="35" TextAlignment="Right" Margin="0,0,5,0" />
                    <!--TextBox x:Name="TitleTextBox" Text="HTML TITLE" Width="75" TextAlignment="Right" Margin="0,0,5,0" /-->
                    <Button x:Name="ClearButton" Content="Clear Results" Click="ClearButton_Click" />
                </StackPanel>
                <TextBlock x:Name="ProcessingTextBlock" MaxWidth="150" Margin="5,5,5,5" Visibility="Collapsed" 
                           HorizontalAlignment="Center" Text="Processing." TextWrapping="Wrap" />
            </StackPanel>
        </Grid>

    </Grid>
</UserControl>


Here's my C#

using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
using ESRI.ArcGIS.Client;
using ESRI.ArcGIS.Client.Tasks;

namespace GeoProcessTest
{
    public partial class MainPage : UserControl
     {
        private DispatcherTimer _processingTimer;
  private Draw MyDrawObject;
  
       

        public MainPage()
        {
            InitializeComponent();

            _processingTimer = new System.Windows.Threading.DispatcherTimer();
            _processingTimer.Interval = new TimeSpan(0, 0, 0, 0, 800);
            _processingTimer.Tick += ProcessingTimer_Tick;

            MyDrawObject = new Draw(MyMap)
            {
                DrawMode = DrawMode.Polyline,
                IsEnabled = true,
                LineSymbol = LayoutRoot.Resources["ClipLineSymbol"] as ESRI.ArcGIS.Client.Symbols.LineSymbol
            };
            MyDrawObject.DrawComplete += MyDrawObject_DrawComplete;
        }

        private void MyDrawObject_DrawComplete(object sender, DrawEventArgs args)
        {
            MyDrawObject.IsEnabled = false;

            ProcessingTextBlock.Visibility = Visibility.Visible;
            _processingTimer.Start();

            GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;

            Graphic graphic = new Graphic()
            {
                Symbol = LayoutRoot.Resources["ClipLineSymbol"] as ESRI.ArcGIS.Client.Symbols.LineSymbol,
                Geometry = args.Geometry
            };
            graphicsLayer.Graphics.Add(graphic);

            Geoprocessor geoprocessorTask = new Geoprocessor("http://GISserver/ArcGIS/rest/services/GeoProcessTest/GPServer/Model");
            geoprocessorTask.UpdateDelay = 5000;
           
            geoprocessorTask.JobCompleted += GeoprocessorTask_JobCompleted;

           
            List<GPParameter> parameters = new List<GPParameter>();
            parameters.Add(new GPLinearUnit("Enter_Buffer_Distance", esriUnits.esriFeet, Int32.Parse(DistanceTextBox.Text)));
            parameters.Add(new GPFeatureRecordSetLayer("Draw_a_line_or_multiple_lines_to_select_parcels_", args.Geometry));
           
            geoprocessorTask.SubmitJobAsync(parameters);
        }

        private void GeoprocessorTask_JobCompleted(object sender, JobInfoEventArgs e)
        {
            Geoprocessor geoprocessorTask = sender as Geoprocessor;

            geoprocessorTask.GetResultDataCompleted += (s1, ev1) =>
            {
                
                GraphicsLayer graphicsLayer = MyMap.Layers["MyResultGraphicsLayer"] as GraphicsLayer;

                
                if (ev1.Parameter is GPFeatureRecordSetLayer)
                {
                    GPFeatureRecordSetLayer gpLayer = ev1.Parameter as GPFeatureRecordSetLayer;
                    
                    if (gpLayer.FeatureSet.Features.Count == 0)
                    {
                        geoprocessorTask.GetResultImageLayerCompleted += (s2, ev2) =>
                        {
                            GPResultImageLayer gpImageLayer = ev2.GPResultImageLayer;
                            gpImageLayer.Opacity = 0.5;
                            MyMap.Layers.Add(gpImageLayer);

                            ProcessingTextBlock.Text = "Greater than 500 features returned.  Results drawn using map service.";
                            _processingTimer.Stop();
                        };

                        geoprocessorTask.GetResultImageLayerAsync(e.JobInfo.JobId, "BufferedParcels");
                        return;
                    }

                    foreach (Graphic graphic in gpLayer.FeatureSet.Features)
                    {
                        graphic.Symbol = LayoutRoot.Resources["ClipFeaturesFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
                        graphicsLayer.Graphics.Add(graphic);
                    }
                }

                ProcessingTextBlock.Visibility = Visibility.Collapsed;
                _processingTimer.Stop();
            };

            geoprocessorTask.GetResultDataAsync(e.JobInfo.JobId, "BufferedParcels");
        }

        private void GeoprocessorTask_Failed(object sender, TaskFailedEventArgs e)
        {
            MessageBox.Show("Geoprocessor service failed: " + e.Error);
        }

        private void ClearButton_Click(object sender, RoutedEventArgs e)
        {
            List<Layer> gpResultImageLayers = new List<Layer>();

            foreach (Layer layer in MyMap.Layers)
                if (layer is GraphicsLayer)
                    (layer as GraphicsLayer).ClearGraphics();
                else if (layer is GPResultImageLayer)
                    gpResultImageLayers.Add(layer);
            for (int i = 0; i < gpResultImageLayers.Count; i++)
                MyMap.Layers.Remove(gpResultImageLayers);

            MyDrawObject.IsEnabled = true;

            ProcessingTextBlock.Text = "";
            ProcessingTextBlock.Visibility = Visibility.Collapsed;
        }

        void ProcessingTimer_Tick(object sender, EventArgs e)
        {
            if (ProcessingTextBlock.Text.Length > 20 || !ProcessingTextBlock.Text.StartsWith("Processing"))
                ProcessingTextBlock.Text = "Processing.";
            else
                ProcessingTextBlock.Text = ProcessingTextBlock.Text + ".";
        }
     }
}




I've attached my Rest End Point Screen shot as a JPEG so you can view the Parameters (if you would like too).
Thanks again for all the help.
Christine
0 Kudos
ChristineZeller
Occasional Contributor
Oh and here's the message/error I see in Fiddler


Here's the only message I'm getting from Fiddler:


Enter_Buffer_Distance {"distance":1,"units":"esriFeet"}

Draw_a_line_or_multiple_lines_to_select_parcels_ {"geometryType":"esriGeometryPolyline","spatialReference":{"wkid":102100},"features":[{"geometry":{"spatialReference":{"wkid":102100},"paths":[[[-12994146.4201889,3909131.50058123],[-12993390.8952937,3909061.21919563],[-12993373.3249473,3909500.47785565]]]},"attributes":{}}]}

f json


{"error":{"code":500,"message":"Error Submitting Job","details":[]}}



Christine
0 Kudos
ChristineZeller
Occasional Contributor
O.K.  I dropped the HTML TITLE Parameter from my model (I figured I have yet to program anything to handle that parameter input so I just took it out of the model) and I got a little further.

Here's the error message I see in fiddler:

{"paramName":"BufferedParcels","dataType":"GPFeatureRecordSetLayer","value":{"geometryType":"esriGeometryPolygon","spatialReference":{"wkid":102100},"features":[],"exceededTransferLimit":"false"}}

and here's the next message:

{"error":{"code":500,"message":"Unable to get value of param 'BufferedParcels' for Job ID 'j8eecb54381584c1bae096002ff8db4e5'. The job may not exist or it could still be executing or could have failed.","details":[]}}

I also checked the arcgis jobs directory to see what was created and the model does run and everything is created in the arcgisserver/arcgisjobs/geoprocesstest_gpserver directly but I noticed something about my selected buffered parcels......THE SHAPEFILE IS EMPTY, which is giving me  empty results across the board.


SO my next question is (maybe I should start and new post for this one) Does it matter that my Parameteres are in different projects???

My GPFeatureRecordSetLayer (esriGeometryPolyline - User/parameter input) is in a different projection than the layer that is being selected and buffered by the Input Parameter and the entire mxd is in a different projection.

The .Net out of the box can handle this but can a silverlight app?

Christine.
0 Kudos