Select to view content in your preferred language

.net SOAP API adding records to table through ArcServer FeatureServerProxy help

2789
4
Jump to solution
05-03-2013 01:47 PM
MichaelRobb
Honored Contributor
I miss the Context server, ArcObjects in 9.3...

There are Zero examples of Feature Service SOAP.
Delete was easy...
Add is a different story...

I am talking about this:
http://resources.arcgis.com/en/help/soap/10.1/index.html#/Add/01vp0000007v000000/

I have no idea how to get this to work...
Ideas?

I know if this was a FEATURE, i would then use  ESRI.ArcGIS.SOAP.GraphicFeature(), but this is a record for a table that is accessible through a feature service.

I am able to get a PropertySet.propertyarray but what to do with it... to get it to a pDataObjects.

  Dim CatalogServiceProxy As New ESRI.ArcGIS.SOAP.ServiceCatalogProxy         CatalogServiceProxy.Url = CatalogServiceURL          'If CatalogServiceProxy.RequiresTokens() = True Then         '    Dim ArcToken As New ArcServerToken(CatalogServiceURL, UserID, Password)         '    Token = ArcToken.GetToken()         'End If          Dim FeatureServiceProxy As New ESRI.ArcGIS.SOAP.FeatureServerProxy         'FeatureServiceProxy.Url = FeatureServiceURL + "token=" + myToken         FeatureServiceProxy.Url = FeatureServiceURL          Dim inputfields As ESRI.ArcGIS.SOAP.PropertySetProperty() = New ESRI.ArcGIS.SOAP.PropertySetProperty(2) {} ' There are TWO Fields / values         Dim pPropertySet As New ESRI.ArcGIS.SOAP.PropertySet         Dim pDataObjects As New ESRI.ArcGIS.SOAP.DataObjects     Dim pPropertySetPropertyLINCNumber As New ESRI.ArcGIS.SOAP.PropertySetProperty             Dim pPropertySetPropertyTrackStatusID As New ESRI.ArcGIS.SOAP.PropertySetProperty     pPropertySetPropertyTrackStatusID.Key = adofields.name                         pPropertySetPropertyTrackStatusID.Value = "Some value"   inputfields.SetValue(pPropertySetPropertyTrackStatusID, 0)             inputfields.SetValue(pPropertySetPropertyLINCNumber, 1)              pPropertySet.PropertyArray = inputfields   ******* WHAT TO PUT HERE *******   'Store the array, ignore the result at this time.             Dim Result As ESRI.ArcGIS.SOAP.EditResult() = FeatureServiceProxy.Add(1, pDataObjects, Nothing, True, False)
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MichaelRobb
Honored Contributor
The Answer if ANYONE is wondering:


use the templateInfo >> Prototype.properties.

Make sure to include the GDB version

and for FeatureServiceProxy.add (1, dObjects, "DEFAULT", true, false)

View solution in original post

0 Kudos
4 Replies
MichaelRobb
Honored Contributor
More questions:

Should the table in the SDE be registered as Versioned ?
Does it require Global ID?

Do you have to initiate an edit session in code?

I tried using the SOAP.graphicFeature and just not pass any geometry just to see...
exception:
Function requires a state to be set for stream....

Meaning, edit?

If Not versioned, I get an unknown error:

error code from return : 127592800  and success = "FAIL"

How does one initiate an 'edit' through SOAP?

Oh and did I ask why ESRI tossed the much easier and more control method of AGSServerConnection, ServerObjectManager ServerContext  IMapServerObjects...
0 Kudos
MichaelRobb
Honored Contributor
Anyone?  Does anyone have Feature Server 10.1 SOAP experience?
0 Kudos
MichaelRobb
Honored Contributor
I tried using the TEMPLATE method, meaning, obtain the table as a template, then adjusting the values...
Or in other words, setting the properties of the new object equal to the properties from the templateInfo object.

The error I get back through an exception (not the Returned result) is "Attribute Column not found"  -2146233087
I get the column name through the table template properties object. How is it unable to find the column when It just told me what it is.


  Dim pDataObjectTable As ESRI.ArcGIS.SOAP.DataObjectTable()

        pDataObjectTable = FeatureServiceProxy.GetTables(Nothing, True)

        Dim pTemplateInfo As ESRI.ArcGIS.SOAP.TemplateInfo()

        pTemplateInfo = pDataObjectTable(0).Templates

        Dim pDataObject As New ESRI.ArcGIS.SOAP.DataObject
        pDataObject.Properties = pTemplateInfo(0).Prototype.Properties

        pDataObject.Properties.PropertyArray(1).Value = "TEST"
        pDataObject.Properties.PropertyArray(0).Value = 123

        Dim dataArray As ESRI.ArcGIS.SOAP.DataObject() = New ESRI.ArcGIS.SOAP.DataObject(0) {}
        dataArray(0) = pDataObject

        Dim dObjects As New ESRI.ArcGIS.SOAP.DataObjects()
        dObjects.DataObjectArray = dataArray


        Dim Result As ESRI.ArcGIS.SOAP.EditResult() = FeatureServiceProxy.Add(1, dObjects, Nothing, False, False)


ESRI?
0 Kudos
MichaelRobb
Honored Contributor
The Answer if ANYONE is wondering:


use the templateInfo >> Prototype.properties.

Make sure to include the GDB version

and for FeatureServiceProxy.add (1, dObjects, "DEFAULT", true, false)
0 Kudos