This topic shows how to connect to an ArcGIS Server Web Service endpoint using pre-created Value objects and a proxy class included with the Web ADF. Since the Web Service Description Language (WSDL) for an ArcGIS Server service type is always the same, the Value objects and proxy class in the Web ADF can be used to connect to any ArcGIS Server Web Service endpoint of the same type (e.g. MapServer). You can also generate your own client-side Value objects and proxy classes by using a SOAP toolkit.
The endpoint for an ArcGIS Server Web service takes the form of service_name/service_type. In the example below, the service_type is "MapServer". There may also be a folder containing one or more services under service_type. In that situation the endpoint takes the form folder_name/service_name/service_type. Folders can be created in ArcCatalog and Manager.
- Setup a web application with the Web ADF assembly, as listed in the assemblies section above.
- Edit the endpoint variable and change the "servicename" to a valid service name.
- Edit the value for the MapServerProxy constructor to include a valid web server name and path to ArcGIS Server Web service endpoints.
string serverName = "localhost";
string instance = "arcgis/services";
// Using the ADF Common API data source implementation of the ArcGIS Server Web Service API
string serviceNameAndType = "MapFusedCache/MapServer";
ESRI.ArcGIS.ADF.ArcGISServer.MapServerProxy agsSoapMapServerProxy = new
ESRI.ArcGIS.ADF.ArcGISServer.MapServerProxy("http://" + serverName + "/" +
instance + "/" + serviceNameAndType);
ESRI.ArcGIS.ADF.ArcGISServer.MapServerInfo agsSoapMapServerInfo =
agsSoapMapServerProxy.GetServerInfo(agsSoapMapServerProxy.GetDefaultMapName());
ESRI.ArcGIS.ADF.ArcGISServer.MapDescription agsSoapMapDescription =
agsSoapMapServerInfo.DefaultMapDescription;
[VB.NET]
Dim serverName As String = "localhost"
Dim instance As String = "arcgis/services"
' Using the ADF Common API data source implementation of the ArcGIS Server Web Service API
Dim serviceNameAndType As String = "MapFusedCache/MapServer"
Dim agsSoapMapServerProxy As ESRI.ArcGIS.ADF.ArcGISServer.MapServerProxy = New ESRI.ArcGIS.ADF.ArcGISServer.MapServerProxy("http://" & serverName & "/" & instance & "/" & serviceNameAndType)
Dim agsSoapMapServerInfo As ESRI.ArcGIS.ADF.ArcGISServer.MapServerInfo = agsSoapMapServerProxy.GetServerInfo(agsSoapMapServerProxy.GetDefaultMapName())
Dim agsSoapMapDescription As ESRI.ArcGIS.ADF.ArcGISServer.MapDescription = agsSoapMapServerInfo.DefaultMapDescription
To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
ESRI.ArcGIS.ADF.ArcGISServer