versaterm001

Problem with Routing Package

Discussion created by versaterm001 on Jan 21, 2013
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

Outcomes