Select to view content in your preferred language

Problem with Routing Package

2305
0
01-21-2013 05:42 AM
Labels (1)
AndrewPurkis
Deactivated User
Hi,

I have a routing package that also generates a directions file for output.  Using the same ModelBuilder Model, I have varied the output type of the directions file between the three options (xml, text and html).  For both xml and html it works perfectly, but I cannot get it to retrieve an .txt directions file.

I'm getting a url returned in the Output parameters:

                      http://127.0.0.1:50000/sxmkFd/outputdir/routetext/output/_ags_Directions1.txt

but when I try to copy it I get a  "The remote server returned an error: (404) Not Found."

The code for copying it locally is:

      if (fileURI != null)
        {
        WebClient wc = new WebClient();

        string suffix = ".txt";
       if (fileURI.EndsWith(".xml"))
          suffix = ".xml";
        else if (fileURI.EndsWith(".html"))
          suffix = ".html";
       
       LocalRouteDirectionsFile = string.Format("{0}{1}", "Directions", suffix);

        try
          {
          wc.DownloadFile(fileURI, LocalRouteDirectionsFile );
          }
        catch (Exception ex)
          {
          errorHandler("getDirectionsFile", "", ex);
          }

Any suggestions?  The same code works for html and xml.

Thanks
Andrew Purkis
0 Kudos
0 Replies