No Slide Title
Download
Report
Transcript No Slide Title
ArcIMS Emulation
with IMSEMU
A Short Introduction to ArcXML
and Reverse Engineering
Paul Ramsey
Refractions Research
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
What Map Servers Do
• “Tell me what you have!?!”
• “I have some layers.”
• “Give me a map of this place!! Use
these layers!”
• “OK, here’s a map.”
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
Map Server Languages
• OpenGIS Web Map Server (URL GET)
– GETCAPABILITIES
– GETMAP
– GETFEATUREINFO
• ESRI ArcXML (XML POST)
– <GET_SERVICE_INFO>
– <GET_IMAGE>
– <GET_FEATURES>
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
ArcIMS Emulation
• Goal: Speak ArcXML Like a Native
MapScript
ArcXML
ESRI Client
IMSEMU
Mapserver
ArcMap
ArcExplorer
Web Page
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
EMU
IMSEMU
•
•
•
•
www.refractions.net
Perl CGI
Mapscript
com.esri.esrimap.Esrimap
Requires:
HTTP Server,
Perl with,
XML::Parser
XML::Writer
Perl Mapscript
OpenSource GIS 2004
Ottawa, Canada
ArcIMS Mapserver
ArcIMS
Mapserver
• One Server,
Multiple Services
• Projection ID
• WKT Projection
• One Server,
Multiple Map Files
• EPSG Number
• Proj4 Projection
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
IMSEMU Installation
• Copy com.esri.esrimap.Esrimap to CGI
directory
• Edit httpd.conf to alias “servlets”
ScriptAlias /servlet/ "/home/www/mapserv/cgi-bin/"
• Edit head of script to point to valid map files
my @files = (
“92K,26910,/home/www/mapserv/maps/92k.map”,
“PGIS,42102,/home/www/mapserv/maps/pgsql.map”
);
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
IMSEMU Operation
• Responds to ArcIMS-style requests
http://mapserver.refractions.net
/servlet/com.esri.esrimap.Esrimap
?ServiceName=catalog
&CustomStream=False
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
POST /servlet/com.esri.esrimap.Esrimap
?ServiceName=BCView
&CustomStream=False HTTP/1.1
Content-Length: 120
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)
Host: mapserver.refractions.net
Connection: Keep-Alive
Cache-Control: no-cache
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.0.1">
<REQUEST dpi="96">
<GET_SERVICE_INFO/>
</REQUEST>
</ARCXML>
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Wed, 24 Oct 2001 17: 08:42 GMT
Content-Type: text/plain
Connection: Keep-Alive
encoding="UTF-8"
Causes ArcMap to CRASH
<?xml version="1.0" ?>
<ARCXML version="1.1"><RESPONSE><SERVICES>
<SERVICE NAME="ActiveMODIS Fires"
SERVICEGROUP="FeatureServer1" ACCESS="PUBLIC"
TYPE="FeatureServer" DESC="" group="*"
STATUS="ENABLED">
<ENVIRONMENT>
<LOCALE country="US" language="en" />
<UIFONT name="Arial" />
</ENVIRONMENT>
</SERVICE>
</SERVICES></RESPONSE></ARCXML>
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
Learning the Lingo
• Read the ArcXML Reference
– google arcxml reference
• Sniff the Wire
ESRI Client
Sniffer
ArcXML
ArcMap
ArcExplorer
Web Page
ArcIMS
HTTPLook
ngrep
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
HTTPLook
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
ngrep
ngrep -d eth0 host 192.168.50.71 and tcp port 80
T 128.128.40.68:80 -> 192.168.50.71:2044 [AP]
HTTP/1.1 200 ..Date: Tue, 01 Jun 2004 04:12:07 GMT..Server: Apache/2.0.42 (
Win32) mod_jk/1.2.4..Content-Language: en..Keep-Alive: timeout=15, max=99..
Connection: Keep-Alive..Transfer-Encoding: chunked..Content-Type: text/plai
n; charset=ISO-8859-1....160.....d....<?xml version="1.0" encoding="UTF-8"?
>..<ARCXML version="1.1">..<RESPONSE>..<IMAGE>..<ENVELOPE minx="-86.5816123
189285" miny="30.3584262004056" maxx="-86.4186258678133" maxy="30.482580309
1411" />.....d....<OUTPUT url="http://coastalmap.marine.usgs.gov/output/GoM
ex_shoreline_change_KAI24668574026.jpg" />..</IMAGE>..</RESPONSE>..</ARCXML
>.....f..
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
use LWP::UserAgent;
perl
$url = "http://198.102.62.145/servlet/com.esri.esrimap.Esrimap
dÅ<?xml
version="1.0" encoding="UTF-8"?>
?ServiceName=ESRI_World&CustomStream=True
<ARCXML
version="1.1">
&ClientLocale=en_US&ClientVersion=3.1";
<RESPONSE>
<IMAGE>
my $ua = new LWP::UserAgent;
<ENVELOPE minx="-209.086532572264" miny="-143.954474147845"
maxx="187.681589360453"
maxy="158.281645579426"
/>
my $req = HTTP::Request->new(POST
=> $url);
dÓ<OUTPUT
file="/net/dbserver/work/common/geonet/maps/ESRI_World_bluemap1191031348
$req->content(qq{<?xml version="1.0" encoding="UTF-8"?><ARCXML
1.gif"
version="1.1"><REQUEST><GET_IMAGE><PROPERTIES><ENVELOPE minx="url="http://redlands.geographynetwork.com/out/maps/ESRI_World_bluemap119
209.08653257226464" miny="-143.95447414784505"
10313481.gif"
/>
maxx="187.68158936045373"
maxy="158.28164557942696" /><IMAGESIZE
</IMAGE>
width="596" height="454" dpi="96" /><LAYERLIST order="true"><LAYERDEF
</RESPONSE>
id="V1 Coverage 3" visible="true”
</ARCXML>
/></LAYERLIST></PROPERTIES></GET_IMAGE></REQUEST></ARCXML>});
f
my $res = $ua->request($req);
if ($res->is_success) {
print $res->content;
}
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
100
00
6E
46
69
45
50
35
35
38
79
20
20
2F
6D
61
6C
65
6F
72
22
53
00
00
3D
2D
6F
3E
45
37
34
37
3D
2F
66
77
61
70
3D
6F
75
65
20
50
00
00
22
38
6E
0D
20
32
34
2E
22
3E
69
6F
70
35
22
67
74
64
2F
4F
00
hexedit
197
64
31
22
3D
0A
6D
32
37
36
31
0D
6C
72
73
33
68
72
2F
6D
3E
4E
66
00
2E
3F
22
3C
69
36
34
38
35
0A
65
6B
2F
37
74
61
6D
61
0D
53
102
www.refractions.net
00
30
3E
31
49
6E
34
31
31
38
00
3D
2F
45
30
74
70
61
70
0A
45
00
22
0D
2E
4D
78
22
34
35
2E
00
22
63
53
33
70
68
70
35
3C
3E
C5
20
0A
31
41
3D
20
37
38
32
00
2F
6F
52
31
3A
79
73
33
2F
0D
3C
65
3C
22
47
22
6D
38
39
38
64
6E
6D
49
33
2F
6E
2F
37
49
0A
100
3F
6E
41
3E
45
2D
69
34
33
31
00
65
6D
5F
34
2F
65
45
30
4D
3C
78
63
52
0D
3E
32
6E
35
36
36
00
74
6F
57
33
72
74
53
33
41
2F
6D
6F
43
0A
0D
30
79
22
30
34
00
2F
6E
6F
33
65
77
52
31
47
41
6C
64
58
3C
0A
39
3D
20
34
35
CF
64
2F
72
2E
64
6F
49
33
45
52
20
69
4D
52
3C
2E
22
6D
35
35
3C
62
67
6C
67
6C
72
5F
34
3E
43
76
6E
4C
45
45
30
2D
61
33
37
4F
73
65
64
69
61
6B
57
33
0D
58
65
67
20
53
4E
38
31
78
22
39
55
65
6F
5F
66
6E
2E
6F
33
0A
4D
72
3D
76
50
56
36
34
78
20
34
54
72
6E
72
22
64
63
72
2E
3C
4C
73
22
65
4F
45
35
33
3D
6D
32
50
76
65
65
20
73
6F
6C
67
2F
3E
69
55
72
4E
4C
33
2E
22
61
36
55
65
74
64
75
2E
6D
64
69
52
0D
6F
54
73
53
4F
32
39
31
78
22
54
72
2F
6D
72
67
2F
5F
66
45
0A
...d....<?xml versio
n="1.0" encoding="UT
F-8"?>..<ARCXML vers
ion="1.1">..<RESPONS
E>..<IMAGE>..<ENVELO
PE minx="-209.086532
572264" miny="-143.9
54474147845" maxx="1
87.681589360453" max
y="158.281645579426"
/>.....d....<OUTPUT
file="/net/dbserver
/work/common/geonet/
maps/ESRI_World_redm
ap5370313433.gif" ur
l="http://redlands.g
eographynetwork.com/
out/maps/ESRI_World_
redmap5370313433.gif
" />..</IMAGE>..</RE
SPONSE>..</ARCXML>..
...f
207
OpenSource GIS 2004
Ottawa, Canada
ArcIMS Modes
• ServiceName=catalog
• CustomStream=True|False
• Encode=True|False
• Form=True|False
• ClientLocale=en_US
• ClientVersion=3.1
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
IMSEMU Capabilities
• Image Serving
–
–
–
–
GET_CLIENT_SERVICES
GET_SERVICE_INFO
GET_IMAGE
FILTER_COORDSYS
(Coordinate Reprojection)
– CustomStream=True|False
– Encode=True|False
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
IMSEMU To Do
• Feature Serving
– GET_FEATURE
(default, xml, xmlnew)
– SPATIALQUERY / QUERYFILTER
• Image Serving with
Selections and Acetates
– Inline LAYER objects.
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada
Questions?
www.refractions.net
OpenSource GIS 2004
Ottawa, Canada