Showing up a service in a map container

1111
5
05-29-2012 04:48 AM
PramodHarithsa
New Contributor
Hi all,
I am a novice in the field of working with ArcGIS ApI's.,

I just wrote a simple JavaScript code, which fetches a service running on ArcGIS server(10.0)

The code looks something like this..

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>GIS Dashboard</title>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/" type="text/javascript"></script> 
<link href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.7/js/dojo/dijit/themes/claro/claro.css" rel="stylesheet" type="text/css" >
<script>
dojo.require("esri.map");
  var map; 
  
   function init()
   {   
    map = new esri.Map("mapDiv",{extent: new esri.geometry.Extent({xmin:-20098296,ymin:-2804413,xmax:5920428,ymax:15813776,spatialReference:{wkid:54032}})
  });
 
    var basemapURL= "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" ;
    var basemap = new esri.layers.ArcGISTiledMapServiceLayer(basemapURL); 
    map.addLayer(basemapURL);
    var mymxdURL= "http://MYSHEC258069D:8399/arcgis/services/t234/MapServer"; 
   var mymxd=new esri.layers.ArcGISDynamicMapServiceLayer(mymxdURL);
   map.addLayer(mymxd);
   }
  dojo.addOnLoad(init);
    

</script>
</head>
<body class="claro"> 
  <div id="mapDiv" style="width:900px; height:600px; border:1px solid #000;"></div> 


</body>
</html>


The map from my local server never loads up
What am i missing here ?
0 Kudos
5 Replies
SrikanthNarra
New Contributor
Hi Infosys,

                     Please try to access the ArcGIS rest end point from your server by using https protocol.May this help you if not revert me always welcome for queries.
0 Kudos
PramodHarithsa
New Contributor
Oh i realise that i am unable to access the rest end point using the server.
How do i make it.. changing the folder properties gives me only binary or soap.. should i alter something in server directories??
0 Kudos
SrikanthNarra
New Contributor
Dear Mr.Pramod,

               If you don't mine let me know how you published the Map service(i think) in ArcGIS server side.
0 Kudos
PramodHarithsa
New Contributor
Dear Mr.Pramod,

               If you don't mine let me know how you published the Map service(i think) in ArcGIS server side.


Well i was able to find the rest end of the service,
the URL now is
http://mXXX258069d:8X99/arcgis/rest/services/t234/MapServer

Thanks a lot srikanth it worked for me!
0 Kudos
SrikanthNarra
New Contributor
Dear Mr.Pramod,
          
                          Foremost thanks for looking into my answer.Even i am working on ArcGIS api for JavaScript , ArcGIS api for Silverlight from the past 7 months.If you don't mine can you please share me your contact information by the way i will make clear my doubts about GIS  i mean to say that i don't have any books, Soft copies as well for getting grip on the GIS concepts. Hope you understand my problem.

Great appreciations if you have any thing with you for me.

Regards
Narra.Srikanth
9160238813
0 Kudos