DCOM Proxy Server

Source: Internet
Author: User

 

Local connections can use the DCOM proxy, but essentially DCOM Proxy is used AO Object and ArcGIS Server Server objects. Therefore, for local connection, the client must have an AO object. Of course, you can also directly use the ao api (which can be considered as the AO proxy of the Remote Server Object) without using the DCOM proxy, (But using DCOM proxy, because the proxy and value object are on the client, it is faster than AO (AO proxiesAll operations inRemote CallBut with AO, we can access the remote fine-grained AO object.), And the proxy belongs to the scope of soap and obtains the DCOM proxy. Currently, I have found two methods:

 

ESRI. ArcGIS. ADF. Identity id = new ESRI. ArcGIS. ADF. Identity (username, password, domain );

ESRI. ArcGIS. ADF. arcgisserver. mapserverdcomproxy mapserver_dcom =

(Mapserverdcomproxy) mapserverdcomproxy. Create (somname, servicename, ID );

// Do something with the DCOM proxy

Mapserver_dcom.dispose ();

 

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. getdefamapmapname ());
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 ();
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.