Select to view content in your preferred language

Relationships not showing up in REST API

9584
21
03-31-2011 09:47 AM
AricMueller
Deactivated User
We have ArcGIS Server 10.0 sp1 running on Windows (behavior exhibited in 2003 and 2008x64).  The published MXD services have relates established in the MXD to Oracle tables.  The tables are access via Oracle authentication.  The related tables are not registered in the geodatabase or arcsde.  In most cases, the tables are public synonyms of objects in another schema.  The relates work fine in ArcMap but do not show up in the REST api once published.  No errors or warnings are logged.  Relates established to other featureclasses do show up.  The behavior seems inconsistent as we have XP workstations with the exact same build of desktop and server which can make a relate to unregistered tables in another Oracle instance.  Can anyone provide any insight on whether this is expected behavior?  In other words, shouldn't any relationship (explicitly established as a relate in ArcMap) be visible to the REST api as long as there are no permissions issues (which there are not here)?
0 Kudos
21 Replies
AricMueller
Deactivated User
It appears to be related to joins.  If I have a join on the featureclass, the relates disappear.  If I remove the join, the relates show up.  If anyone can confirm this as either a known bug or expected behavior I'd appreciate.  thanks in advance.
0 Kudos
ChrisHamilton1
Emerging Contributor
Hi, i was wondering if you have had any feedback on this issue?

I have the same issue. A parcels featureclass with two joined tables and one related table. All tables are loaded into the MXD but the relationships and joins are manual - not via a relationship class When i publish the map server the joins and related persist (i can check via the identify tool with the Map Service in Arccatalog). However the relationships do not show up in the REST API like it does in this sample: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/MapServer/1  I don't even see the relationships: heading...

The tables are from an external SQL server database. Is there extra permissions that are required specifically for REST?
0 Kudos
AricMueller
Deactivated User
I haven't heard anything but am planning to submit it as a bug.  I just haven't gotten a chance yet.  I have confirmed the behavior on half a dozen systems.  If you have a join on a layer, any relationships disappear in the REST API.  I'm pretty much being forced to do spatial views to accomplish the joins so I can get at the relationships.
0 Kudos
ar4
by
Emerging Contributor
While not the same issue I have a similar issue with layers not appearing in the REST ( or from SOAP API) where the mxd opens correctly with data in ArcMAP.

In my case it appears to the  results of a data connection that is not successful (for as yet undetermined reasons) is that elements will not appear in the published service.

I suggest that you look for errors ( or clues )  in the server log . The log messages are not terribly helpful but that provide a starting point .
0 Kudos
AricMueller
Deactivated User
thanks for the feedback.  Sadly, there are no errors thrown.  I can remove the join, restart the service, and clear the rest cache and the relates appear just fine.
0 Kudos
ChrisBeaudette
Frequent Contributor
I'm having similar -- if not identical -- issues.  My problem is complicated by the fact that I can't use spatial views since I need to edit features from a Flex Web client using a client-side FeatureLayer and a server-side FeatureServer.

I'm using AGS v10 SP2 and SDE v10 SP2 for Oracle and Oracle 10g on server that's remote from AGS. 

At first I created a synonym to a table in another schema in the same Oracle instance, added the synonym to my ArcMap document, and created a join in my ArcMap document to the synonym.  When I did so, if I browsed to the FeatureServer in the REST catalog then I got a 'server 500' error (per this thread).  The MapServer didn't throw an error, but the attributes from the joined synonym didn't show up either.  Admittedly I did this in v10 SP1 and haven't re-checked this configuration using v10 SP2. 

Then after upgrading to v10 SP2 I:
- created synonyms in my SDE instance to the tables that I wanted to get attribute info from in the other schema (same Oracle instance)
- created a view (Oracle view, not a spatial view) to the synonym tables
- added the view to my ArcMap document
- created a join in ArcMap to the view

In ArcMap I can see all columns from the joined view just fine.  My REST service no longer throws a server 500 error for the FeatureServer, but neither do I see the columns from my view in either the MapServer or the FeatureServer.

If I'm not mistaken, I can't use spatial views in lieu of my feature classes since you can't edit views.  Nor can I use relationship classes as long as the tables I'm joining to are in another schema (since the tables at both ends of the relationship class must be registered in the geodb).  Nor can I use on-the-fly relates in ArcMap since the related attributes aren't actually appended to the feature class attribute table (and from reading the rest of this thread it looks like relates are broken too when making the join).

Any thoughts on how I can get attribute data from other tables into my feature classes while also being able to edit my feature classes using the v10 REST APIs??
0 Kudos
ChrisBeaudette
Frequent Contributor
An update to this, using AGS v10 SP2, SDE v10 SP2 for Oracle and Oracle 10g:

I created a join in an ArcMap document to a local table, i.e. a table in ArcSDE (not registered) as opposed to a table in another schema.  Again, in ArcMap I can view the attribute table fine and all columns are displayed.

However when viewing the layer in the REST catalog, e.g. http://servername/ArcGIS/rest/services/servicename/MapServer/0 and .../FeatureServer/0, I see the following:
*  .../servicename/MapServer:  Layer shows up under 'Layers' label and joined table shows up under 'Tables' label
*  .../servicename/MapServer/0: layer displays fine *and* all attributes -- including those from the joined table -- are shown in the Fields section
*  .../servicename/FeatureServer:  Layer does *not* show up under 'Layers' label, but table shows up under 'Tables' label
*  .../servicename/FeatureServer/0 throws "An unexpected error occurred processing the request", as one would expect since it doesn't show up under Layers
*  .../servicename/FeatureServer/1:  shows table details, including all Fields

When restarting the AGS service, the following errors are reported (my map layer in ArcMap is called 'All Sites'):

<Msg time='2011-06-22T10:37:14' type='INFO3' code='17002' target=servicename.MapServer' methodName='GraphicFeatureLayer.InitByLayer' machine='machinename' process='4444' thread='3088'>Error in generating Renderer Specific Information for All Sites.</Msg>
<Msg time='2011-06-22T10:37:14' type='ERROR' code='17000' target='servicename.MapServer' methodName='GraphicFeatureServer.InitializeLayers' machine='machinename' process='4444' thread='3088'>Initialization of Layer: All Sites failed.</Msg>

No errors are reported for servicename.FeatureServer. Logging is set to 'Verbose'.

I get the exact same behavior in all respects if I register the table with the geodatabase.
0 Kudos
ChrisBeaudette
Frequent Contributor
Followed up w/ ESRI Support.  They consider this 'as designed'.

BUG LOGGED AGAINST IT (rejected since 'as designed'):
NIM062309: When a Feature Service's source map document contains a layer that participates in an ArcMap table join, that layer's attribute fields will not be listed when viewing that layer's properties in ArcGIS Services Directory.

Status: Rejected
This is actually by design  - we don't support joins.
A geodatabase relationship class where you query related records has been provided with feature services to support this case. You will need to make sure that the table and the feature class in the relationship are in the map when they publish.

WORKAROUND:
NIM069615: Request to allow the viewing and/or editing of attributes in a Feature Service that are from an ArcMap table join in the source map document.
0 Kudos
RaviNarayanan
Esri Contributor
This could be the bug that Aric is referring to:
NIM061963: Query Related Records does not work if there is both a join and relate on the same feature (http://support.esri.com/en/bugs/nimbus/TklNMDYxOTYz)
0 Kudos