Select to view content in your preferred language

Saving point data through WCF service

714
3
07-13-2012 05:44 AM
BonnieGolla
Deactivated User
I am rewriting an enterprise desktop application for the web. The original desktop application had saved data to a point feature class through ArcMap 9.3.1 & Visual Studio 2008, utilizing Java classes to pass the point data, while other data relevant to the individual points were stored in Oracle databases and passed via SQL script.  To rewrite this application, I am using ArcGIS Server for .NET and Visual Studio 2010 and SQL script on the db side.  To pass point data, I have created a WCF service, and I can connect to the table through the following code:

        ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Server)

        Dim aoInit As IAoInitialize = New AoInitializeClass()
        aoInit.Initialize((esriLicenseProductCode.esriLicenseProductCodeArcServer))

        Dim propertySet As IPropertySet = New PropertySetClass()

        propertySet.SetProperty("SERVER", server)

        propertySet.SetProperty("INSTANCE", instance)

        propertySet.SetProperty("DATABASE", database)

        propertySet.SetProperty("USER", user)

        propertySet.SetProperty("PASSWORD", password)

        propertySet.SetProperty("VERSION", Version)

        Dim workspaceFactory As IWorkspaceFactory = New SdeWorkspaceFactoryClass()
        Return workspaceFactory.Open(propertySet, 0)

However, at this point, I am somewhat at a loss.  How do I proceed to upload the data?  Must I reuse the Java code, or can this be done another way?

Thanks in advance for any help.

Bonnie Golla
Applications Developer
PA DEP
0 Kudos
3 Replies
LanceCrumbliss
Frequent Contributor
you may have more luck with that question in the ArcObjects forum.
0 Kudos
JoeHershman
MVP Alum
While using WCF is certainly a workable approach I really think you should take a look at using a Server Object Extension (SOE).  This allows you to run an extension attached to the map service that runs in the server process and is accessible as a rest endpoint.  So things like connecting to the server are not needed because it already is running in the server.  Plus it has easy access to the data sources in your map service.

You could use either the Java API or the .Net API for ArcObjects to develop the extension.  I think a lot of the Java code you have already written would be re-usable with this approach.

Good Luck
Thanks,
-Joe
0 Kudos
BonnieGolla
Deactivated User
Thanks, I will look into the SOE. 

Bonnie
0 Kudos