Select to view content in your preferred language

new problem REST query 10.1 - every other request fails (400 unable to complete oper)

10593
25
Jump to solution
12-13-2012 06:17 AM
deleted-user-Ohz6rwd1kavx
Deactivated User
Hi

We are upgrading to ArcGIS Server 10.1 SP1 from 10.0.

We have noticed a new problem where REST layer queries are failing every other request. It is quite strange, but you can reproduce it by simply reissuing requests in browser or Fiddler.

Here is an example request (can use &f=html also, same result).

http://serverx/arcgis/rest/services/foldery/servicez/MapServer/0/query?where=%28%28KeyInstn+in+%2810...

Every other request fails with this result (json):

{"error":{"code":400,"message":"Unable to complete operation.","details":[]}}

Clue:I started looking this while tracking down possible change to how ESRI is treating OutputFields in 10.1 compared to 10.0.

Anybody else seeing this?

Any recommendations on where to check next to narrow this one down?

Thanks,

-Cory
Tags (2)
0 Kudos
25 Replies
JessicaLott
Deactivated User
The workarounds are

you can do request in POST

or

dirty the query


var dirty = (new Date()).getTime();
var query = new esri.tasks.Query();
query.where = "MyField= " + MyValue+ " AND " + dirty + "=" + dirty; 
...



Is this how I would accomplish this in C#?

 var dirty = DateTime.UtcNow;
            Query query = new Query();
            query.ReturnGeometry = true;
            query.OutFields.Add("*");
            query.Where = QueryParametersTextbox.Text + " AND " + dirty + "=" + dirty;



Thanks in advance.
0 Kudos
TerryGiles
Frequent Contributor
Jessica,

That's pretty close, but since DateTime.UtcNow will return a DateTime object, you'll need to convert that into something that can be put in the where clause  -

           string dirty = DateTime.UtcNow.Ticks.ToString();
           Query query = new Query();
            query.ReturnGeometry = true;
            query.OutFields.Add("*");
            query.Where = QueryParametersTextbox.Text + " AND " + dirty + "=" + dirty;



Terry
0 Kudos
BillyYancey
Occasional Contributor

I am on 10.2.2 all updates and patches applied and JS API 3.10 and I still have the issue. even sequencing the queries will not work, nor does the "dirty" query technique. I have not been able to make JS API to use POST yet (not sure if I can) and I am on enterprise geodatabase (postgres). Two queries back to back or simultaneous, the first one always successful, the second one fails. Reordering them guarantees that there is no issue with the query itself. Extremely frustrating...

0 Kudos
SadanandacharB1
Occasional Contributor

Hi, still you have the same issue ?

ref ArcGIS Help (10.2, 10.2.1, and 10.2.2)

Sadanand.

0 Kudos
BillyYancey
Occasional Contributor

No! I am not sure how did I solve it though. IT was a long time ago.

0 Kudos
SadanandacharB1
Occasional Contributor

Even I had the same issue in Sliverlight api with server 10.2.1, FeatureLayer query fails when using date in where clause.

It works for me when change the query syntax like below:

featureLayer.Where = "SURVEY_DATE >= date '" + dpFromDate.SelectedDate.Value.ToString("yyyy-MM-dd")

+ "' and SURVEY_DATE <= date '" + dpToDate.SelectedDate.Value.ToString("yyyy-MM-dd") + "'";

ref the link for more details : ArcGIS Help (10.2, 10.2.1, and 10.2.2)

0 Kudos