Change a geometry service to a geoprocessing service

Discussion created by ilyass on Jan 14, 2014
Latest reply on Jan 25, 2014 by ilyass
Hi everyone,

I need your help in one problem that i am facing the last 3 days.
I create one web app using javascript that allow me to add point in the map and create buffer around each point (I used Geometry Service), now i should merge any buffer who intersect with the other one, so i create one model in model builder using Dissolve All and i publish it as a geoprocessing service.
That give me a url like: http://IP:6080/arcgis/rest/services/Service_Name/GPServer/Model_Name.

I tried to repalce the URL that i used for the geometry service by this URL but its not working.
Below is the Head code for the geometry service if you can help me to found the changes that i should do to have the result.


    function(dom, domAttr, array, Color, parser, esriConfig, Map,
Graphic, GeometryService, BufferParameters, Draw, SimpleMarkerSymbol,
SimpleLineSymbol, SimpleFillSymbol)

      var map, geo, tb;
      map = new Map("map", {
        basemap: "streets",
        center: [-122.4, 37.785],
        zoom: 13,
      }); = "/proxy"; = false;  

geo = new GeometryService("");
    map.on("load", initToolbar);

**  Initialize the drawing toolbar
function initToolbar(evtObj) {
      app.tb = new Draw(;
      app.tb.on("draw-end", drawPoint);

// Array where points are saved
var list = new Array();

    ** Draw point
function drawPoint(evtObj) {
      // Get the click geometry
   var geometry = evtObj.geometry; 
   // Point symbol
      var symbol = new SimpleMarkerSymbol(
  new SimpleLineSymbol(
    new Color([255,0,0]),
  new Color([0,255,0,0.25])
   // Add point to the map
      var graphic = new Graphic(geometry, symbol);;

   // Store the point geometry

    **  Create buffer around points
function doBuffer() {
   // Stop drawing points

   // Show the zoom slider;
      // Setup the buffer parameters
      var params = new BufferParameters();
      params.distances = [ dom.byId("distance").value ];
      params.bufferSpatialReference = new esri.SpatialReference({wkid: dom.byId("bufferSpatialReference").value});
      params.outSpatialReference = map.spatialReference;
      params.unit = GeometryService[dom.byId("unit").value];
   params.geometries = list;
   // Launch buffer calculation
      app.geo.buffer(params, showBuffer);

    **  Draw buffer on the map
    function showBuffer(geoms) {
   // Symbol of the buffer
      var symbol = new SimpleFillSymbol(
        new SimpleLineSymbol(
          new Color([255,0,0,0.65]), 2
        new Color([255,0,0,0.35])
   // Add the buffer graphics to the map
   array.forEach(geoms, function(geometry) {
        var graphic = new Graphic(geometry, symbol);;
    app = {
      map: map,
      tb: tb,
      geo: geo,
   buffer: doBuffer
  ** Click on Foggy Zone button
  function foggyZoneClick(){
  ** Click on Point button
  function pointClick(){

Any help is appreciate (Its really urgent :( )