ArcGIS Server APIs
SOAP
1)XML-structured
語言。
2)
對
server objects
和
server object extensions
可用。
3)
設計用作
stateless
交互。
4)Catalog
請求由
IServerCatalogAdmin
接口處理。
5)Service
請求由
IRequestHandler
接口處理。
ArcObjects
1)
遠程與
GIS Server
上的
ArcObjects
交互。
2)
使用客戶端的
Primary Interop Assemblies (PIA)
和
object libraries
。
3)
通過
SOM
訪問獲得
ArcGIS Server services
。
4)
設計用作
stateless
和
stateful
交互。
ArcGIS Server MapResource 類型
A 、 MapResourceInternet – 連接到 Web service endpoint
B 、 MapResourceLocal – 連接到 Server Object Manager
1) 訪問 ServerContext
2) 使用 ArcObjects
?
ArcGIS Server Internet: SOAP 編程
1)MapResourceInternet
MapServerProxy, 訪問 value objects
2) 通訊是 stateless
3) 使用 pooled objects
Dim mapRes as ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceInternet
mapRes = gisFunc.Resource
Dim mapsProxy as ArcGISServer.MapServerProxy = mapRes.MapServerProxy
Dim mapInfo as ArcGISServer.MapServerInfo =
mapsProxy.GetServerInfo(mapsProxy.GetDefaultMapName())
Dim mapDesc as ArcGISServer.MapDescription = mapInfo.DefaultMapDescription
Dim mLayerInfo as ArcGIServer.MapLayerInfo()
mLayerInfo = mapRes.MapServerInfo.MapLayerInfos
Dim layerDescs as ArcGISServer.LayerDescription()
layerDescs = mapDesc.LayerDescriptions
?
ArcGIS Server Local: ArcObjects 編程
1) 遠程訪問 ArcObjects
2)MapServerLocal
MapServer > IMapServer (COM) >IMapServerObjects (COM)
3) 通過 .NET 部件訪問高級的 functionality
?
Dim mapFunc as IMapFunctionality = Map1.GetFunctionality(0)
Dim ags_mr as ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal
ags_mr =
CType(mapFunc.Resource,ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal)
' Access the ArcObjects COM ServerObject directly
Dim mapServer as ESRI.ArcGIS.Carto. IMapServer = CType(ags_mr.MapServer,IMapServer)
Dim mapServerObjs as ESRI.ArcGIS.Carto.IMapServerObjects
mapServerObjs = CType(mapServer,IMapServerObjects)
Dim map as ESRI.ArcGIS.Carto.IMap = mapServerObjs.Map
' Now perform more ArcObjects operations
Dim featClass as IFeatureClass = CType(map.Layers(0)).FeatureClass,
?
?
深入 ArcGIS Server Local API
1)MapResourceLocal
通過 DCOM 訪問 server 上的 ArcObjects
ServerContext
2) 所有的過程在遠程完成
?
?
?
ArcObjects 遠程編程
1) 能在服務器上創建新的對象
2)MapServerLocal
ServerContextInfo
ServerContext
3) 不需要 release servercontext
Dim ags_mr as ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal
ags_mr =
CType(qfunc.Resource,ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal)
' Create a new ArcObjects COM objects
Dim context as ESRI.ArcGIS.Server.IServerContext = ags_mr.ServerContextInfo.ServerContext
Dim pnt as ESRI.ArcGIS.Geometry.IPoint = context.CreateObject("esriGeometry.Point")
pnt.X = 60
pnt.Y = 100
Dim topo as ESRI.ArcGIS.Geometry.ITopologicalOperator = CType(pnt, Itopological)
?
常用開發模式
--首先建立連接 Identity identity = new Identity("username", "pwd", "domain"); AGSServerConnection connection = new AGSServerConnection("fmc-pca187", identity); connection.Connect(); --獲得服務器對象 IServerObjectManager m_pSOM = connection. ServerObjectManager ; IServerContext m_pServerContext = m_pSOM. CreateServerContext (" testMap" , "MapServer" ) ; IMapServer pMapServer = m_pServerContext . ServerObject as IMapServer ; --使用服務器對象 IMapServerObject s pMapServerObject s = ( IMapServerObject s) pMapServer ; IMap pMap = pMapServerObject s. get_Map (pMapServer .DefaultMapName) ; IFeatureLayer p FLayer = ( IFeatureLayer) pMap. get_Layer(0) ; IFeatureClass p FeatureClass = p FLayer . FeatureClass ; int i = p FeatureClass. FeatureCount (null) ; --釋放服務器對象 m_pServerContext . ReleaseContext () ;
??
?
?
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
