Select to view content in your preferred language

Accessing the Body of a Request in an SOE

1388
2
10-01-2012 12:59 PM
NicoleSchmidt
Emerging Contributor
I have run into a limitation on URL size (2000 characters) when POSTing to a custom SOE I developed, so I find I need to move some (or all) of my request parameters into the body of a request.  Based on the documentation here: http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/extension.html  I got the impression that the ArcGIS Server SOE framework would just automagically figure out that my parameters were in the body instead of in the URL.  But apparently this is not the case.  (BTW - I actually am using 10.1, not 10.0 but could not find that relevant page for 10.1 and figured it had not changed that much).

This is my schema definition:
 RestOperation updateOper = new RestOperation("UpdateGIS",
  new string[] { "updatepayload" },
  new string[] { "json" },
  UpdateGISOperHandler);


and this is the signature of my method
        private byte[] UpdateGISOperHandler(NameValueCollection boundVariables,
                  JsonObject operationInput,
                  string outputFormat,
                  string requestProperties, 
                  out string responseProperties)


When this is called I was expecting that the parameter (which I moved to the body) to be in operationInput but it is not.

Can anyone point out what I might be missing here?
Tags (2)
0 Kudos
2 Replies
nicogis
MVP Frequent Contributor
who call your soe can use post (for example with esri.request you can use usePost 
http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/namespace_esri.htm (>2000 however it's set automatically)) or you use proxy but on soe you don't need change.
0 Kudos
NicoleSchmidt
Emerging Contributor
Okay the issue was that I was putting the f parameter in the url and the rest in the body.  I also think I had the content-type wrong.  Once I put both of my query parameters in the body and switched to a content type of "application/x-www-form-urlencoded", it started working.
0 Kudos