Select to view content in your preferred language

The Shortest path analyse

611
0
04-14-2011 05:36 PM
wangyingjie
New Contributor
Hi:
    I have been unable to complete a shortest path analyse with mobile 9.3.  I got the shortestroute toolbox from the "ArcGIS\TutorialData\ArcTutor\GP Service Examples\ShortestRoute" folder , and public it on the server. When I used it in my mobile ,I couldn't get the result, the result is "esrifailed". The code is bellow. Any help is appreciated!(note: i use the Mapcache). anybody who has the related code, please post me, Thanks! my email is "wyj120@yahoo.com.cn".
THE LOG IS "The value does not exist. ERROR 000732: Input network analysis layer: Dataset Route does not exist or is not supported ERROR 000735: Sub layer: Value is required".
GP_Server.GPValue[] gpValues = new GP_Server.GPValue[1];
gpValues[0] = m_gpInputFeatureRecordsetLayer;               
string jobID;
jobID = m_gpServer.SubmitJob(m_gpToolInfo.Name, gpValues, new GP_Server.GPResultOptions(), new GP_Server.PropertySet());
GP_Server.esriJobStatus jobStatus = GP_Server.esriJobStatus.esriJobSubmitted;
while (jobStatus != GP_Server.esriJobStatus.esriJobSucceeded && jobStatus != GP_Server.esriJobStatus.esriJobFailed)
{
Thread.Sleep(1000);
jobStatus = m_gpServer.GetJobStatus(jobID);
}

                if (jobStatus == GP_Server.esriJobStatus.esriJobSucceeded)
                {
                    GP_Server.GPResultOptions gpResultOptions = new GP_Server.GPResultOptions();
                    GP_Server.GPResult gpResult = m_gpServer.GetJobResult(jobID, null, gpResultOptions);

                    m_gpResultFeatureRecordsetLayer = (GP_Server.GPFeatureRecordSetLayer)gpResult.Values[0];

                    CreatePolyline();

                }
                else                 {
                    MessageBox.Show("Failed!");
                }
0 Kudos
0 Replies