SOI Not Intercepting GET requests

1324
6
06-04-2017 09:47 PM
JordanKing3
New Contributor III

Hey Guys,

We've built a SOI to intercept calls to a Feature Service, specifically the Query operation. What we've noticed just today is that the SOI seems to always send back a default response to a GET request, where as a POST will be intercepted and send back the 'edited' response.

What's interesting is that the server still logs the full output as if it had been intercepted. So is there something specific we might need to do to ensure we are not sending back a default response to GET requests?

We are only intercepting REST requests, not SOAP.

Cheers,

Jordan

0 Kudos
6 Replies
nicogis
MVP Frequent Contributor

what's the versione of ags?

Can you give further details for 'default response' ?

0 Kudos
JordanKing3
New Contributor III

Hey Domenico,

AGS v 10.4.1

This is the default response to a layer Query:

{"objectIdFieldName":"RECORD_ID","globalIdFieldName":"","geometryType":"esriGeometryPoint","spatialReference":{"wkid":102100,"latestWkid":3857},"hasZ":false,"features":[]}

We're intercepting this result and building the output "features" array based on our own logic. Everything seems to look fine in the logs, it even is logging that it is overriding the output response. I've done some more digging around and it seems as if it is only happening when we have the following GET request:

http://localhost:6080/arcgis/rest/services/testing/<serviceName>/FeatureServer/1/query?f=json&where=...

If I change that request to include a single outField, or even remove the *, it all seems to work as expected. However, as previously mentioned, it seems strange, because the logs show that the code goes through the exact same process and even shows the intercepted result it is outputting. But it never appears to be output...

Wondering if it could be a bug?

Cheers,

Jordan

0 Kudos
nicogis
MVP Frequent Contributor

I don't know if I have understand

I have tried with ags 10.5

I have created a map service with feature access enable (only query)

I run your request  on first layer in service ...?f=json&where=1%3D1&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=*&outSR=102100

I see response correct (here in code -> variable output) and also in service directory:

Is it the problem ?

0 Kudos
JordanKing3
New Contributor III

Hey Domenico,

It turns out it was most likely the browser and AGOL caching the original GET response, back when the SOI still wasn't working. Once I cleared the cache, it seemed to respond OK.

Thanks for your help on this though!

Cheers,

Jordan

0 Kudos
JamesCrandall
MVP Frequent Contributor

Do you have a C# example of how to add fields for an SOI?  I have a JArray of values that I'd like to add/enrich to existing map service output.

0 Kudos
nicogis
MVP Frequent Contributor
0 Kudos