Dear Gurus!
How to use arcgis server from the winForms application?
May be as follows ArcObjects API Reference for ArcGIS Engine or there exist other way?
It's easy to use mapControl in arcObjects and map control in "http://schemas.esri.com/arcgis/client/2009" namespace (wpf, silverlight)
<esri:Map x:Name="myMap" Background="White" WrapAround="true" Extent="3200000,8500000,4250000,10130000" MouseClick="Map_MouseClick" > <esri:OpenStreetMapLayer ID="OSMLayer" Style="Mapnik" /> </esri:Map>
Can't anybody show how to solve simililar problems (with code example) in winForms or some reference would be nice?
Could you explain in more detail what you're needing to accomplish? What is it that you're needing to do with the server.
I have the project , which I wrote 5 yeas ago. The program are on the server and clients run it after enter the server via tsclient. Now I I have arcgis for server and use it from wpf and silverlight project. I want to rewrite my winForms project. In xaml of silverlight project
<esri:Map x:Name="myMap" Background="White" WrapAround="true" Extent="3200000,8500000,4250000,10130000" MouseClick="Map_MouseClick" > <esri:OpenStreetMapLayer ID="OSMLayer" Style="Mapnik" /> <esri:ArcGISDynamicMapServiceLayer ID="Karelia" Url="http://myserver:6080/ArcGIS/rest/services/karelia/MapServer" /> <esri:FeatureLayer ID="routes_osm" Url="http://myserver:6080/ArcGIS/rest/services/karelia/MapServer/1" MouseEnter="FeatureLayer_MouseEnter_1"> </esri:FeatureLayer> <esri:FeatureLayer ID="bridges" Visible="False" Url="http://myserver:6080/ArcGIS/rest/services/karelia/MapServer/2" MouseEnter="FeatureLayer_MouseEnter" > </esri:FeatureLayer>
</esri:Map>
So it's needed to to use some feature layers, to draw some objects , to solve geometry tasks and so on. Also need to use OSM layer.
Now I try to use connection factory
IAGSServerConnectionFactory AGSConnectionFactory = new AGSServerConnectionFactory();
but get an error message -
"The required class is missing in ClassFactory".
Sorry, I forgot
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
An error has disappeared
I successfully connected through the Internet connection with next code:
IAGSServerConnectionFactory AGSConnectionFactory = new AGSServerConnectionFactory(); IPropertySet connectionProps = new PropertySet(); connectionProps.SetProperty("URL", "http://serverIP:6080/arcgis/admin"); IAGSServerConnection AGSConnection = AGSConnectionFactory.Open(connectionProps, 0); IAGSEnumServerObjectName enumSOName = null; enumSOName = AGSConnection.ServerObjectNames; IAGSServerObjectName SOName = null; SOName = enumSOName.Next(); while (SOName != null) { Debug.Print(SOName.Name + ": " + SOName.Type); SOName = enumSOName.Next(); }
But I can't to connect through local connection in the LAN with next code:
IAGSServerConnectionFactory AGSConnectionFactory = new AGSServerConnectionFactory(); IAGSServerConnection AGSConnection = null; IPropertySet connectionProps = new PropertySet(); connectionProps.SetProperty("machine", "MONITOR"); AGSConnection = AGSConnectionFactory.Open(connectionProps, 0);
where "MONITOR" - the name of the computer in LAN. How to specify the name of the server arcgis in this expression, and whether it is required to be connected with an setting of user (the member of agsusers group) and password?
I tried to do so
IGISServerConnection connection = new GISServerConnection(); connection.Connect("http://serverIP:6080/arcgis/admin");
but I get an error
"Server RPC is not available"
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.