If ArcIMS is used, you cannot leave SDE. If SDE is used, you cannot access the database. It's easy to use flex to access data. It's troublesome to access the database! In general, the. NET platform solutions include WebService and remoting. The remoting efficiency is good for Intranet or VPN, but it is still difficult to do so. In general, WebService is widely used, but the efficiency of WebService is not flattering. Today, flex focuses on another idea --asp.net, today, it is depressing because the map data has been migrated to Oracle for half a day to take care of the Flex progress. The original Chinese layer name and field have been changed to English, IMS access does not seem to have any Chinese characters. It is better to define a layer name and field comparison table in both Chinese and English in the database, which can be compensated by accessing the database through flex, if WebService is used, it will inevitably take a long time for the buzycursor to check whether URLRequest can be used to send data and obtain results when accessing the IMS server. The efficiency seems to be good, so I thought of writing several Asp.net pages and accessing the database through Asp.net (a friendly daab ).
No more nonsense. First, write an Asp.net webpage to access an Oracle database.
Add the previous section in Web. config to read the database configuration for daab.
<Connectionstrings>
<Add name = "pc_ora" connectionstring = "Data Source = gisdata; user id = ***; Password = ***" providername = "system. Data. oracleclient"/>
</Connectionstrings>
Create a page and write it in pageload
Database DB = databasefactory. createdatabase ("pc_ora ");
Streamreader sr = new streamreader (this. Request. inputstream );
String tbname = Sr. readtoend ();
String sqlgetlayerinfo = "select tabcap from sys_tabname t where upper (T. tabname) like '" + tbname. toupper () + "'";
Idatareader DR = dB. executereader (commandtype. Text, sqlgetlayerinfo );
This. response. contenttype = "text/XML ";
While (dr. Read ())
{
Response. Write (Dr [0]. tostring ());
}
In this way, the queried data can be written to the page.
How can we get it?
The omnipotent URLRequest was launched.
Not to mention that when the layer name is obtained through arcIMS
Public Function Set Name (NA: string): void
{
This. Name = Na;
VaR capreq: URLRequest = new URLRequest ();
Capreq. url = "http: // 10.25.2.45/webwork/flexdataservice/getdata. aspx ";
Capreq. method = "Post ";
Capreq. Data = Na;
VaR urlloader: urlloader = new urlloader ();
Urlloader. addeventlistener (event. Complete, layercompletehandler );
Try {
Urlloader. Load (capreq );
} Catch (error: Error ){
MX. Controls. Alert. Show ("sending request error", "ASP. NET Request", 4, null );
}
}
The above IP address is an intranet address. Do not access
C # In the code
Streamreader sr = new streamreader (this. Request. inputstream );
String tbname = Sr. readtoend ();
The result is naturally the na value in the ActionScript code.
I don't need to talk about it. Just pull Dada like accessing IMS and parse it to get data.
Private function layercompletehandler (Event: Event): void
{
VaR Loader: urlloader = urlloader(event.tar get );
VaR ST: String = loader. Data;
This. Caption = ST. substr (0, st. indexof ("\ r "));
VaR fldreq: URLRequest = new URLRequest ();
} Note: "\ r". If data is completely retrieved, HTML code is included.
In general, this method is much faster than WebService, But what should we do with batch data? For example, for Attribute tables or something, it seems that WebService is still required or Asp.net can be used through dataset XML, and no attempt has been made. Finally, e is invisible on the interface.
I suddenly found that my layer tree can only display the layer name, but this can't be done. How can I say that layer control and menu are still required? How can I implement TOC, see the ArcIMS WebGIS path of flex RIA in the next phase -- flex custom control implementation layer TOC
PS: in fact, this issue has been written for a long time, because it is busy. When I accidentally searched for the materials, I saw an alumnus. Maybe it was the younger brother who reproduced the previous two issues. Thank you for your comments!