Dear Users,
I need to call a dynamic mapservice.
The parameter provided to me are
Title | Map_Service_Name | Map_Service_Url | Is_Required | Service_Type | Purpose | Is_Print | Map_Service_Order | Is_Restricted |
2D GSI | 2D | https://mapserver.XXXXXX.com/ArcGIS/rest/services/GXXXX2D_XXXX/XXXX | 1 | Cached | Seismic Query | 1 | 4 | 0 |
How can I add the mapservice to my application?
If i add it with new esri.layers.ArcGISDynamicMapServiceLayer(layer url);
I get the following error. 401 Unauthorized
{"currentVersion":10.2,"fullVersion":"10.2.0","soapUrl":"https://mapserver.eXXXXXXX.com/arcgis/services","secureSoapUrl":null,"authInfo":{"isTokenBasedSecurity":false}}
Thanks in advance for the help.
Aditya kumar
Solved! Go to Solution.
You said you want to load a ArcGISDynamicMapServiceLayer, but in that example, you specify ArcGISTiledMapServiceLayer. Unless a service is published as tiled, you won't be able to create it that way.
You should be able to take the URL of the map service, paste in in a browser window and have some results returned. If you get some sort of permission error, the service has been secured and won't be able to use it without some sort of authentication. If you can't view its rest service endpoint, then you won't be able call the service in code either.
If you do see information about the service using the URL, then you have a syntax problem when constructing this layer. If you post the lines of code, it will be easier for people to see where you might have a problem.
Hi Tracy,
Thanks for the reply. When I paste the url in the browser I can easily see the data. But when I bring the same in my map its giving me error.
var GSI_2D = new esri.layers.ArcGISTiledMapServiceLayer("https://mapserver.xxxxx.xxxx.com/ArcGIS/rest/services/Global/xxxxxxx/MapServer",
{"opacity":1.0,"visible":true});
Thanks
Aditya Kumar
You said you want to load a ArcGISDynamicMapServiceLayer, but in that example, you specify ArcGISTiledMapServiceLayer. Unless a service is published as tiled, you won't be able to create it that way.
Hi Tracy,
Thanks for the reply.
I am sorry for writing Dynamic service ,its actually a tiled map service and I am calling it the way I mentioned above.