Select to view content in your preferred language

Access IGeoDataServer from a 10.2 SOE

770
2
06-30-2014 03:54 PM
MeleKoneya
Frequent Contributor
I created a SOAP SOE in ArcGIS Server 10.0 and am trying to convert it to 10.2.   As part of the SOE,  I access a Feature Class from an IGeoDataServer.    I used to be able to connect to the ArcGIS Server using the machine name  and iterate through the ServerObjectNames, but due to local connections not being supported in 10.2 I can no longer do that.  

I changed my code to use an internet connection,  but keep getting a "bad syntax error" when trying to retrieve the ServerObjectNames.  

Our ArcGIS server map services are secured using web authentication and AD roles.    I tried to put in a valid user but it did not work either.

This code works on an ArcGIS console application but not within my SOE.   How can I connect to the IGeoDataServer from an SOE?

Thanks,

Mele


private IGeoDataServer InitGeoDataServerFromNetworkServer(String machineName, String
    serviceName)
        {
            // Create a property set for connection properties.
            IPropertySet propertySet = new PropertySetClass();
            //propertySet.SetProperty("Machine", machineName);

            propertySet.SetProperty("user", @"domain\mapuser");
            propertySet.SetProperty("password", "1234");
            propertySet.SetProperty("CONNECTIONTYPE", "esriConnectionTypeInternet");
            propertySet.SetProperty("URL", "http://server/arcgis/rest/services/");

            
            // Connect to the server and get an enumerator for its objects.
            IAGSServerConnectionFactory agsServerConnectionFactory = new
                AGSServerConnectionFactoryClass();
            IAGSServerConnection agsServerConnection = agsServerConnectionFactory.Open
                (propertySet, 0);
            IAGSEnumServerObjectName enumServerObjectName =
                agsServerConnection.ServerObjectNames;
            enumServerObjectName.Reset();

            // Iterate through the objects to locate the GeoData service.
            IAGSServerObjectName serverObjectName = null;
            IGeoDataServer geoDataServer = null;
            while ((serverObjectName = enumServerObjectName.Next()) != null)
            {
                if (serverObjectName.Name == serviceName)
                {
                    IName name = (IName)serverObjectName;
                    geoDataServer = (IGeoDataServer)name.Open();
                    break;
                }
            }

            return geoDataServer;
        }
Tags (2)
0 Kudos
2 Replies
ErinBrimhall
Deactivated User
Hi Mele,

One option would be to consume the Geodata Service from your SOE using SOAP.

Download the .NET SOAP Proxy Libraries and reference them in your SOE.

Then work with a GeoDataServerProxy instance, setting up its connection properties (e.g. the URL of the Geodata service and any necessary credentials) before invoking the desired service methods.
0 Kudos
MeleKoneya
Frequent Contributor

Erin,

Thanks for the links.    I think this will very useful.    I did not know about the SOAP Proxy Libraries so I appreciate you showing me these.

I would have responded earlier but could not find this post now that it is on GeoNet

Mele

0 Kudos