JavaScript API: adding layer doesn't work

Discussion created by joe.zou on Jul 9, 2013
I've created a map on ArcGIS online, adding a layer by uploading a csv file. This works fine, see map at link

Now I'm trying to simulate this in JavaScript API. First I create a Web API service that returns the same data set I've got in csv file.
This is published on my local webserer. In my web page, I create a webmap, adding a layer that references this web API:

  function init() {
        var options = {
            basemap: "gray",
            center: [153.115672, -30.296312],
            zoom: 14
        var mapServiceURL = "";

        // Create map and call Init function
        map = new esri.Map("mapDiv", options);

        map.addLayer(new esri.layers.ArcGISDynamicMapServiceLayer(mapServiceURL));

The webmap is displayed, but the layer doesn't have any effect. What's missing? Am I at the right track? Your help is greatly appreciated.