Closest Facility Error 400- Invalid URL

4265
10
12-07-2010 04:23 AM
RamiSourani
New Contributor
Greetings,

I am working on Closest Facility in Route Task (myRouteTask.SolveClosestFacilityAsync)
I am using the same code in http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ClosestFacility
but using my service published in our server.

The SolveClosestFacility_Failed is triggered and having the error message = "" (Just "Network Analysis error" in the message box)

I have checked ESRI Closest Facility REST layer http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Closest%20Facility with respect to mine,
The difference was that I don't have "Supported Operations:   Solve Closest Facility" in my REST Closest Facility layer

Am I missing some settings to enable "Supported Operations:   Solve Closest Facility"?

FYI: Below link is on my intranet just putting it for your reference:
http://gisserver/ArcGIS/rest/services/NetworkDS/NAServer/Closest%20Facility

Thank you
0 Kudos
10 Replies
DominiqueBroux
Esri Frequent Contributor
Could you share the result of the request on this URL : http://gisserver/ArcGIS/rest/services/NetworkDS/NAServer/Closest%20Facility ?
0 Kudos
RamiSourani
New Contributor
The html request returns "Error 400- Invalid URL".
0 Kudos
DominiqueBroux
Esri Frequent Contributor
And what is the result of this request :  http://gisserver/ArcGIS/rest/services/NetworkDS/NAServer
0 Kudos
RamiSourani
New Contributor
Sorry I miss understood your previous question, now it is clear:
-The result of the http://sourani-pc/ArcGIS/rest/services/LAND/NetworkDS/NAServer is:

LAND/NetworkDS (NAServer)
Service Description:
Route Layers:
Route
Service Area Layers:
Service Area
Closest Facility Layers:
Closest Facility
Supported Interfaces:   REST   SOAP

-The result of the http://sourani-pc/ArcGIS/rest/services/LAND/NetworkDS/NAServer/Closest%20Facility is:

Network Layer: Closest Facility
Layer Type: esriNAServerClosestFacilityLayer

Impedance: Length

Restrictions:

Accumulate Attribute Names:

Attribute Parameter Values:

Use Hierarchy: false

Hierarchy Attribute Name:

Hierarchy Level Count: 0

Hierarchy Max Values:

Hierarchy Num Transitions:

Snap Tolerance: 0

Max Snap Tolerance: 5000

Snap Tolerance Units: esriMeters

Ignore Invalid Locations: true

Restrict U-Turns: esriNFSBAllowBacktrack

Output Spatial Reference: 102113

Default Cutoff Value:

Facility Count: 1

Travel Direction: esriNATravelDirectionToFacility

Output Line Type: esriNAOutputLineTrueShapeWithMeasure

Directions Language: en_US

Directions Length Units: esriNAUKilometers

Directions Time Attribute: Time

Network Analysis Classes:
Class Name: Facilities
Field Name: Name
Default Value:
Candidate Fields: Name, Address, Label, Location, Facility, Origin, Destination, WayPoint, Description, Title, DepotName
Field Name: SourceID
Default Value: -1
Candidate Fields: SourceID, SID, Source
Field Name: SourceOID
Default Value: -1
Candidate Fields: SourceOID, SOID
Field Name: PosAlong
Default Value: 0
Candidate Fields: PosAlong, PA, Pos
Field Name: SideOfEdge
Default Value: 2
Candidate Fields: SideOfEdge, SOE
Field Name: CurbApproach
Default Value: 0
Candidate Fields: CurbApproach, SideOfStreet, SideApproach, CurbSide, Curb
Field Name: Attr_Length
Default Value: 0
Candidate Fields: Attr_Length, Length, SegLen, SegLength
Field Name: Attr_Time
Default Value: 0
Candidate Fields: Attr_Time, Time, Delay, ServiceTime, SrvTime, StartDepotServiceTime, StartSrvTime, StartSrv
Field Name: Cutoff_Length
Default Value:
Candidate Fields: Cutoff_Length, Cut_Length
Field Name: Cutoff_Time
Default Value:
Candidate Fields: Cutoff_Time, Cut_Time
Class Name: Incidents
Field Name: Name
Default Value:
Candidate Fields: Name, Address, Label, Location, Incident, Origin, Destination, Description, Title, DepotName
Field Name: TargetFacilityCount
Default Value:
Candidate Fields: MaxFacilities, Cutoff, FacilityCount, TargetFacilityCount, MaxFacilityCount, FacilityCutoff
Field Name: SourceID
Default Value: -1
Candidate Fields: SourceID, SID, Source
Field Name: SourceOID
Default Value: -1
Candidate Fields: SourceOID, SOID
Field Name: PosAlong
Default Value: 0
Candidate Fields: PosAlong, PA, Pos
Field Name: SideOfEdge
Default Value: 2
Candidate Fields: SideOfEdge, SOE
Field Name: CurbApproach
Default Value: 0
Candidate Fields: CurbApproach, SideOfStreet, SideApproach, CurbSide, Curb
Field Name: Attr_Length
Default Value: 0
Candidate Fields: Attr_Length, Length, SegLen, SegLength
Field Name: Attr_Time
Default Value: 0
Candidate Fields: Attr_Time, Time, Delay, ServiceTime, SrvTime, StartDepotServiceTime, StartSrvTime, StartSrv
Field Name: Cutoff_Length
Default Value:
Candidate Fields: Cutoff_Length, Cut_Length
Field Name: Cutoff_Time
Default Value:
Candidate Fields: Cutoff_Time, Cut_Time
Class Name: Barriers
Field Name: Name
Default Value:
Candidate Fields: Name, Address, Label, Location, Barrier, Description, Title, DepotName
Field Name: SourceID
Default Value: -1
Candidate Fields: SourceID, SID, Source
Field Name: SourceOID
Default Value: -1
Candidate Fields: SourceOID, SOID
Field Name: PosAlong
Default Value: 0
Candidate Fields: PosAlong, PA, Pos
Field Name: SideOfEdge
Default Value: 2
Candidate Fields: SideOfEdge, SOE
Field Name: CurbApproach
Default Value: 0
Candidate Fields: CurbApproach, SideOfStreet, SideApproach, CurbSide, Curb
Network Dataset: NETWORK_ND


Network Attributes:

Length
Usage Type: esriNAUTCost
Units: esriNAUMeters
Data Type: esriNADTDouble
Parameter Names:
Time
Usage Type: esriNAUTCost
Units: esriNAUMinutes
Data Type: esriNADTDouble
Parameter Names:
Network Sources:

streetsref
Usage Type: esriNETEdge
Units: esriNSTEdgeFeature
ID: 1

NETWORK_ND_Junctions
Usage Type: esriNETJunction
Units: esriNSTSystemJunction
ID: 2


Note as you can see at the end, I can not find "Supported Operations: Solve Closest Facility" which is seen in your service: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Closest%20Facility

-The following result:
{"error":{"code":400,"message":"","details":["Invalid URL"]}}
is returned if I put the Solve Closest Facility url directly in the browser (http://sourani-pc/ArcGIS/rest/services/LAND/NetworkDS/NAServer/Closest%20Facility/solveClosestFacili...)
0 Kudos
JenniferNery
Esri Regular Contributor
Have you tried making the web request from your web browser directly? This URL exists? http://sourani-pc/ArcGIS/rest/services/LAND/NetworkDS/NAServer/Closest%20Facility/solveClosestFacili...
Try to put the input parameters here as you see them from Fiddler when your app makes the request.

Kindly look at Post#14 from this thread for reference http://forums.arcgis.com/threads/14730-Area-And-Perimeter
0 Kudos
RamiSourani
New Contributor
I already did this:

-The following result:
{"error":{"code":400,"message":"","details":["Invalid URL"]}}
is returned if I put the Solve Closest Facility url directly in the browser taken from Fiddler http://sourani-pc/ArcGIS/rest/services/LAND/NetworkDS/NAServer/Closest%20Facility/solveClosestFacili...
0 Kudos
RamiSourani
New Contributor
Just a note, my problem is in the Nearest Facility layer, it does not have "Supported Operations: Solve Closest Facility" as seen in ESRI Facility Layer when viewed in the browser.

The question is why I don't have it and how can I add it, is there some settings should be made? or anything else?

Thank you
0 Kudos
JenniferNery
Esri Regular Contributor
What I mean to say is go to the Network Analyst service directly such as
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Closest%20Facility/s...
and enter each input separate as displayed on Fiddler's Inspectors WebForms (see the screenshot from previous link).

See if you still get the same results as when you did when you copied the web request URL.

Maybe the Network Analyst service itself is inaccessible or the web request is not correctly formed. It's easier to identify the problem when you do one step at a time.
0 Kudos
RamiSourani
New Contributor
Dear Jennifer,

I don't have the "Solve Nearest Facility", this is my problem,

For example in Route layer, if I click on Solve, I can enter the parameters, but in the Nearest Facility I don't have anything to click on.

Kindly check attached screenshot,

Thank you for the support.
0 Kudos