AnsweredAssumed Answered

Problems with defined proxy page. What am I doing wrong?

Question asked by csergent08 Champion on Nov 21, 2014
Latest reply on Nov 24, 2014 by csergent08

I am trying to add proxy information to my site and my JavaScript, but it's returning errors. I don't need these urls to be secure. The following is my code for my application and my proxy.config file for the application published at:


App Code:


<!DOCTYPE html>



        <title>Create a Map</title>

        <meta http-equiv="content-type" content="text/html; charset=utf-8">

        <meta name="viewport" content="initial-scale=1,maximum-scale=1, user-scalable=no">

        <link rel="stylesheet" href="">

        <link rel="stylesheet" href="">


            html, body, #mapDiv










                background: #fff;

                border: 2px solid #666;

                border-radius: 5px;

                bottom: 20px;

                color: #666;

                font-family: arial;

                height: auto;

                left: 20px;

                margin: 5px;

                padding: 10px;

                position: absolute;

                width: 300px;

                z-index: 40;



            #feedback a


                border-bottom: 1px solid #888;

                color: #666;

                text-decoration: none;


            #feedback a:hover, #feedback a:active, #feedback a:visited {

                border: none;

                color: #666;

                text-decoration: none;





                padding: 0 0 10px 0;





                padding: 10px 0 0 0;



        <script src=""></script>


            var map;

            require(["esri/map", "esri/config",















                     "dojo/domReady!"], function (Map, esriConfig, arcgisutils, Print, Extent,

                                                  ArcGISDynamicMapServiceLayer, ArcGISTiledMapServiceLayer,

                                                  FeatureLayer, GeometryService, PrintTemplate, arrayUtils, dom, on, parser


            ) {



                         /* The proxy comes before all references to web services */

                         /* Files required for security are proxy.config, web.config and proxy.ashx

                         - set security in Manager to Private, available to selected users and select Allow access to all users who are logged in

                         (Roles are not required)


                         The proxy section is defined on the ESRI sample. I have included it as

                         part of the documentation reads that the measuring will not work.

                         I thought that might be important.




                         // Proxy Definition Begin

                         //identify proxy page to use if the toJson payload to the geometry service is greater than 2000 characters.

                         //If this null or not available the project and lengths operation will not work.

                         // Otherwise it will do a http post to the proxy.

                = "proxy.ashx";

                = true;



                         // Proxy Definition End





                         // set custom extent

                         var initialExtent = new Extent({

                             "xmin": 777229.03,

                             "ymin": 1133467.92,

                             "xmax": 848340.14,

                             "ymax": 1185634.58,

                             "spatialReference": {

                                 "wkid": 3435





                         // create map and set slider style to small

                         var map = new arcgisutils.createMap("mapDiv", {

                             showAttribution: false,

                             sliderStyle: "small",

                             extent: initialExtent




                         // add imagery

                         var tiled = new ArcGISTiledMapServiceLayer("");


                         // set operational layers

                         var operationalLayer = new ArcGISDynamicMapServiceLayer("", { "opacity": 0.5 });

                         // add operational layers




                         // declare geometry service

                         esriConfig.defaults.geometryService = new GeometryService("");







    <body class="soria">

        <div id="mapDiv"></div>





proxy.config file


<?xml version="1.0" encoding="utf-8" ?>

<ProxyConfig allowedReferers="*"




        <!-- serverUrl options:

            url = location of the ArcGIS Server, either specific URL or stem

            matchAll = true to forward any request beginning with the url

            token = (optional) token to include for secured service

            dynamicToken = if true, gets token dynamically with username and

              password stored in web.config file's appSettings section.


        <serverUrl url=""









<!-- See for more information -->