Access Archive Class with ArcGIS Server

7127
15
06-17-2016 06:29 AM
MaxDemars
New Contributor III

Hello,

I would like to know if there is a way to access the archive class in a Map Service on ArcGIS Server.

I have a Map Service with feature class stored in a SDE GeoDatabase with Archiving and Versionning enabled.

My questions are:

  1. When features are added/updated/removed on a feature class with Archiving using the Feature Access capability of ArcGIS Server, does the Archive Class is updated?
  2. Is it possible to query the Archive Class in order to retrieve features at a perticular moment using the Feature Access or Mapping capabilities through the REST API?
  3. When I try to publish a Map Service containing an Archive Class to ArcGIS Server I have an error saying: Layer's data source is not registered with the geodatabase (Feature Service). Does it means it's not possible to publish an Archive Class?
15 Replies
RobertNalewajk
New Contributor II

ahh - I think the confusion might be that the data I'm talking about is versioned - which, based on the link you added, works differently than non-versioned data when archiving.  I didn't know they were treated differently.

to clarify I'm working with versioned data.  thanks!

0 Kudos
BerendVeldkamp
Occasional Contributor II

What you need to do is to publish the Historical Archive.

  • Open ArcMap
  • Add the Archived featureclass. This contains the current view of the features, i.e. the latest version. You don't have GDB_FROM_DATE and GDB_TO_DATE.
  • Open the Geodatabase History toolbar
  • Select the featureclass in the TOC and click on the Add Historical Archive button
  • This will add a new layer to the TOC, containing all features, including both time fields
  • Optionally, enable time on that layer and specify the start time and end time fields. If you do this, you can specify the time field in a REST call to ArcGIS Server. If you don't, you can still query the history, but you need to build the where clause including a date manually
  • Publish as a mapservice

As far as I know, _H tables are created the moment you disable archiving and choose to maintain the history. Enable and disable again will create _H1, _H2 et cetera.

Berend

RobertNalewajk
New Contributor II

Thanks Berend,

that's all working great for me except for the last point - my publishing keeps failing and I can't figure out why.  maybe I'll try putting together a new from scratch geodatabase and give it another go.  I'll let you guys know if there is any progress.

thanks!

0 Kudos
MichaelRobb
Occasional Contributor III

What is the failure?   

What do the GP Results messages say?

Is the failure during analyze / publishing (same thing)?

What do the server logs say?  (usually will give enough information to figure errors out)

0 Kudos
MichaelRobb
Occasional Contributor III

I just saw this...  scratch geodatabase?  as in scratch gdb?  I'm sure its just a mixup of terminology, but you are aware that an Enterprise Geodatabase is needed...  e.g. SQL, Oracle, HANA, etc.

0 Kudos
RobertNalewajk
New Contributor II

Hi, 

thanks for your persistence in this!

To answer your questions in reverse order I'm using a SQL Server Enterprise Geodatabase.  ArcGIS 10.4, SQL 2012 SP3.  for the initial testing I was using an Enterprise database that I had previously created for some data work, but wanted to create a new one "from scratch" just for this testing, sorry for the confusion.

for the failure - after publishing (no errors during analyze) - I get:

"Packaging succeeded, but publishing failed.  ERROR 001487: Failed to update the published server with the server-side data location.  Please see the server's log for more details.  Please conuslt the GP Results Window for enhanced error description or contact your administrator for the server logs."

The GP Results Window shows a successful Stage Service, but a failure to upload the service definition (I have published other services while this issue has persisted so it shouldn't be a standard publishing issue).  The GP window shows errors 001487 (as above) and Error 001369: "Failed to create the service."

The Server logs show me 3 errors (all severe).

1. Failed swizzling service

2. Failed to create the service: Updating the server connection string for layer TimeTestPoint Archive failed.  Attempted connection string was: . . . Table name is TIMETEST.DBO.TIMETESTPOINT_H.  Please verify the data exists on the server.

3. Error executing tool.  PubishServiceDefinition . . . Errors 001487 and 001369 as above.

the 2nd error seems to be the diagnostic one here to me, although I don't understand why its happening.  The connection string that is registered with Server is the same connection string the data is added with so access shouldn't be an issue.

thanks again!

0 Kudos