I have written about ArcIMS development under flex and posted ArcGIS Server without ADF on ESRI's forum before. It feels a bit fragmented and I am not used to writing blogs online, now I have a live writer. It feels good. I feel like writing a column. Some people once leave a message and don't know how to develop Flex + ArcIMS. With the accumulation of some knowledge (mainly the interoperability between. NET and flex), I feel that what I wrote is a bit out of date. So we have a new series. It's not easy to write. Let's take a look.
Necessary software: ArcIMS 9.2, Visual Studio 2005 or 2008, flex builder 2.0 or later versions, fluorinefx, Microsoft Enterprise Library, the first two of which are believed to be down from there, fluorinefx is available at http://www.fluorinefx.com/. Enterprise Library is also available on Microsoft's website. Currently, vs 3.1 SP1 is required for Version 2005.
First, create an empty solution named imsfxserver in 2005 and add a new fluorinefx servicelibrary project named imsfxlib.
Then add a fluorinefx ASP. NET web site project named imsfxserver. Remember to select HTTP from the location drop-down box instead of the file system.
The following is a reference. Because ArcIMS is relatively simple, you only need to add an ESRI reference, that is, ESRI. ArcGIS. ADF. Connection. After that, you can connect to ArcIMS!
First in ASP. add imsfxlib references in the. NET project, and then add a class in imsfxlib named imsconnection. In this class, we need to use reomtingservice attribute to identify our service, for simplicity, we only add a method, getimgurl ();
The file code is as follows:
Using system;
Using system. Collections. Generic;
Using system. text;
Using ESRI. ArcGIS. ADF. Connection. IMS;
Using fluorinefx;
Namespace imsfxlib
{
[Remotingservice]
Public class imsconnection
{
Protected httpconnection m_imsconn;
Public imsconnection ()
{
M_imsconn = new httpconnection ("http: // localhost/servlet/COM. ESRI. esrimap. esrimap? Servicename = wx & Client Version = 4.0 ");
M_imsconn.servicename = "NJ ";
M_imsconn.user = "brune_cnblog ";
M_imsconn.password = "Brune ";
}
Public String getimgurl ()
{
String S = m_imsconn.send ("<? XML version = \ "1.0 \" encoding = \ "UTF-8 \"?> <ArcXML version = \ "1.1 \"> <request> <get_image> <Properties> </get_image> </request> </ArcXML> ");
Return S;
}
}
}
OK. Now we are running the imsfxserver website. Remember to set console. aspx as the start page. The interface is as follows:
Click the call button and the result is displayed.
Copy the address following the URL of the element output to the browser and check it out.
The Map appears, so far it has been able to access IMS through fluorine's service. The next article will introduce how to use fluorine service in flex to display the map in flash.