ESRI.ArcGIS.ADF.ArcGISServer.Local
MapServerDcomProxy Class
Members  Example  See Also  Send Feedback
ESRI.ArcGIS.ADF.ArcGISServer Namespace : MapServerDcomProxy Class




An ArcGIS Server map server proxy used when communicating with the server over DCOM.

Object Model

MapServerDcomProxy Class

Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class MapServerDcomProxy 
   Inherits ESRI.ArcGIS.ADF.ArcGISServer.MapServerProxy
   Implements IETagSupport 
Visual Basic (Usage)Copy Code
Dim instance As MapServerDcomProxy
C# 
[SerializableAttribute()]
public class MapServerDcomProxy : ESRI.ArcGIS.ADF.ArcGISServer.MapServerProxy, IETagSupport  

Example

This example illustrates how to create a MapServerDcomProxy and call ExportMapImage to generate a new map image.
C#Copy Code
ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection connection = null;
ESRI.ArcGIS.Server.IServerContext serverContext = null;
 
try
{
    connection = new ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection();
 
    connection.Host = "localhost";
    connection.Connect();
 
    ESRI.ArcGIS.Server.IServerObjectManager serverObjectManager = connection.ServerObjectManager;
 
    serverContext = serverObjectManager.CreateServerContext("MyMapService", "MapServer");
 
    ESRI.ArcGIS.ADF.ArcGISServer.MapServerDcomProxy mapservice = new
        ESRI.ArcGIS.ADF.ArcGISServer.MapServerDcomProxy(serverContext, true);
 
    ESRI.ArcGIS.ADF.ArcGISServer.MapServerInfo mapinfo = mapservice.GetServerInfo(mapservice.GetDefaultMapName());
    ESRI.ArcGIS.ADF.ArcGISServer.MapDescription mapdesc = mapinfo.DefaultMapDescription;
 
    ESRI.ArcGIS.ADF.ArcGISServer.ImageType imgtype = new ESRI.ArcGIS.ADF.ArcGISServer.ImageType();
    imgtype.ImageFormat = ESRI.ArcGIS.ADF.ArcGISServer.esriImageFormat.esriImagePNG;
    imgtype.ImageReturnType = ESRI.ArcGIS.ADF.ArcGISServer.esriImageReturnType.esriImageReturnURL;
 
    ESRI.ArcGIS.ADF.ArcGISServer.ImageDisplay imgdisp = 
        new ESRI.ArcGIS.ADF.ArcGISServer.ImageDisplay();
    imgdisp.ImageHeight = 500;
    imgdisp.ImageWidth = 500;
    imgdisp.ImageDPI = 96;
 
    ESRI.ArcGIS.ADF.ArcGISServer.ImageDescription imgdesc = 
        new ESRI.ArcGIS.ADF.ArcGISServer.ImageDescription();
    imgdesc.ImageDisplay = imgdisp;
    imgdesc.ImageType = imgtype;
 
    ESRI.ArcGIS.ADF.ArcGISServer.MapImage mapimg = mapservice.ExportMapImage(mapdesc, imgdesc);
 
    System.Net.HttpWebRequest webreq = System.Net.WebRequest.Create(mapimg.ImageURL) as HttpWebRequest;
    System.Net.HttpWebResponse webresp = webreq.GetResponse() as HttpWebResponse;
    System.Drawing.Image img = System.Drawing.Image.FromStream(webresp.GetResponseStream());
}
catch (Exception ex){}
finally
{
    serverContext.ReleaseContext();
    connection.Dispose();
}

Remarks

Asynchronous methods inherited from the Web service proxy base class are not supported over DCOM. This includes the Begin\End and Async\Completed patterns. More specifically any asynchronous method names that start with Begin or End or end with Async are not supported. Any asynchronous events that end with Completed are not supported.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2011 All Rights Reserved.