Silverlight Relationship Query (REST 10.0) Failing with Error 400

3310
0
09-10-2014 04:11 PM
HeidiHughes
New Contributor

We are running ArcGIS Server 10.0(REST)/Silverlight API 3.1/.NET 4.0/Oracle 11g/sde

(I will not be able to provide Fiddler data, so please don't suggest that)

The data in the database is versioned.  There is a feature service that contains featureclasses and related tables. Relationship classes exist in the database and when I look at the properties of them in ArcCatalog, the type is Simple.  The relationships are there in the feature service directory also. 

The feature service layers are consumed as Feature Layers in a Silverlight API based web application.  Client-side caching is turned off, as is auto-save.  Doing regular queries works fine.  I can also iterate through the relationships on a specific layer, obtaining such properties as Name, ID, ect.

For some reason, attempting relationship queries on a feature layer in the code behind fails with Error code 400.  Also if I attempt a regular or relationship query using the services directory, those also fail with similar error messages.

queryTask = new QueryTask("https://<websitename>/ArcGIS/rest/services/TEST_MainView_Full_JAB/FeatureServer/3");

queryTask.ExecuteRelationshipQueryCompleted += new EventHandler<RelationshipEventArgs>(QueryTask_ExecuteRelationshipQueryCompleted);

RelationshipParameter relationshipParameters = new RelationshipParameter();

                relationshipParameters.ObjectIds = new int[] {Convert.ToInt32(feature.Attributes["OBJECTID"]) };

                relationshipParameters.OutFields = new string[] { "*" };

                relationshipParameters.RelationshipId = 7;

                relationshipParameters.ReturnGeometry = false;

                relationshipParameters.OutSpatialReference = map.SpatialReference;

                relationshipParameters.DefinitionExpression = "1=1";

queryTask.ExecuteRelationshipQueryAsync(relationshipParameters);

One thing that might be causing havoc is that all the featureclasses have an integer ID field which has the same number as the OBJECTID (not the way I would have designed the tables).  It is this ID field that is the foreign key in the related tables.

I've been trying tweaking the URLs made from attempting the queries from the services directory, but no luck even when I make the query as simple as possible.

Does anyone have any clues?  I know once I get to ArcGIS for Server 10.1, that I'll have more options with respect to setting relationship query

properties.

Thanks in advance, Jewell

0 Kudos
0 Replies