Select to view content in your preferred language

Unable to use the sample Edit without editor widget

2072
11
01-08-2013 08:19 PM
ouyajam
New Contributor
I'm trying to run the sample "Edit without editor widget" on my computer. But all the edits I made simply can not apply to the featurelayer. However the online live sample is able to apply every edit. Can anybody tell me why?Thanks a lot!
0 Kudos
11 Replies
KellyHutchins
Esri Frequent Contributor
You probably need to setup a proxy page. Instructions on how to do so are here:

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp/ags_proxy.htm

Once you've setup the proxy modify the following line in the code to point to the location of your proxy.

    esri.config.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx";
0 Kudos
AdrianMarsden
Regular Contributor II
Hi - I've got a similar issue - but it seems to be IE specific.  I have the proxy all set and Chrome and Firefox work fine./  Yet IE (8 & 9) fail

In Fiddler I see a 500 error reported for

POST /proxy/proxy.ashx?http://our server/arcgis/rest/services/test/edit/FeatureServer/0//applyEdits HTTP/1.1

With the page being returned as the normal .NET page

Server Error in '/proxy' Application.  and saying how to make changes to the web.config (which I don't have) to get better errors.

I've just used the default proxy pages from the esri site (I'd edited the previous ones) and still get the error.

When run on the server - fiddler shows a 500 page with

[TABLE="width: 100%"]
[No relevant source lines]
[/TABLE]


Any ideas.

ACM
0 Kudos
KellyHutchins
Esri Frequent Contributor
When I first setup a proxy I usually set the following value in the proxy.config file to false. This will proxy any site which is good for testing.

<ProxyConfig mustMatch="false">

After verifying that the proxy works using the above setting you can set it back to true then use the <serverUrl> tags to specify the URL of the sites that should be proxied.
0 Kudos
AdrianMarsden
Regular Contributor II
Si instead of

   <serverUrl url="http://hummer/ArcGIS/rest/services"               matchAll="true"
               dynamicToken="true"
               ></serverUrl>


Would you simply have

   <serverUrl                matchAll="flase"
               dynamicToken="true"
               ></serverUrl>


?  The comments in the proxy.config isn't very clear.  To me " matchAll = true to forward any request beginning with the url"

Means that if I set the URL to "http://myserver/" and matchAll = True the any request beginning "http://myserver/" will work.

Cheers

ACM
0 Kudos
AdrianMarsden
Regular Contributor II
Sorry - misread your post - see the setting you mean now.  I'll try that.
0 Kudos
KellyHutchins
Esri Frequent Contributor
Insted of the matchAll attribute for the serverUrl tags look at the top of the proxy.config file and you should see a <ProxyConfig> tag. This tag has a mustMatch attribute. If you set it to false it will proxy everything which is great for testing to see if your proxy works.


<?xml version="1.0" encoding="utf-8" ?>
<!-- Proxy config is used to set the ArcGIS Server services that the proxy will forward to.
        
        mustMatch: true to only proxy to sites listed, false to proxy to any site -->
<ProxyConfig mustMatch="false">
  <serverUrls>
    <!-- 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="http://sampleserver1.arcgisonline.com/arcgis/rest/services/" 
               matchAll="true"></serverUrl>
    <serverUrl url="http://sampleserver2.arcgisonline.com/arcgis/rest/services/" 
               matchAll="true" 
               token=""></serverUrl>
    <serverUrl url="http://server.arcgisonline.com/arcgis/rest/services/"
               matchAll="true"></serverUrl>

  </serverUrls>
  
</ProxyConfig>


0 Kudos
BayNgo
by
Deactivated User

Hi Kelly!

I set proxy.config:

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

<ProxyConfig mustMatch="false">

    <serverUrls>

        <serverUrl url="http://<myservername>/arcgis/rest/services/"

               matchAll="true"/> 

    </serverUrls>

</ProxyConfig>

and I put folder "dotnet" (consist of: proxy.ashx, proxy.config, web.config) to: C:\inetpub\wwwroot

then my code in web app is:

esriConfig.defaults.io.proxyUrl ="http://<myservername>/dotnet/proxy.ashx";

I tested this link: http://<myservername>/dotnet/proxy.ashx?http://<myservername>/ArcGIS/rest/services/map/sde_commune/M...  with no error, but all the edits I made can not apply to my featurelayer.

Please help me, thanks!

0 Kudos
AdrianMarsden
Regular Contributor II
Thanks for that - we posted at the same time - however, my proxy.config  now looks like this and IE still fails


<?xml version="1.0" encoding="utf-8" ?>
<!-- Proxy config is used to set the ArcGIS Server services that the proxy will forward to.
        
        mustMatch: true to only proxy to sites listed, false to proxy to any site -->
<ProxyConfig mustMatch="false">
  <serverUrls>
    <!-- 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="http://eddc-gis2"
               matchAll="true"
               ></serverUrl>
  </serverUrls>
  
</ProxyConfig>




I'll see if I get get a page on the internet later.

IE just does nothing.

Cheers

ACM
0 Kudos
KellyHutchins
Esri Frequent Contributor
Did you follow the steps in the ASP.net section in the help to setup your proxy in IIS?

http://help.arcgis.com/en/webapi/javascript/arcgis/jshelp/#ags_proxy
0 Kudos