arcims emulation with imsemu

21
OpenSource GIS 2004 Ottawa, Canada www.refractions.net ArcIMS Emulation with IMSEMU A Short Introduction to ArcXML and Reverse Engineering Paul Ramsey Refractions Research

Upload: mireya

Post on 13-Jan-2016

43 views

Category:

Documents


0 download

DESCRIPTION

ArcIMS Emulation with IMSEMU. A Short Introduction to ArcXML and Reverse Engineering. Paul Ramsey Refractions Research. 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.”. Map Server Languages. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

ArcIMS Emulationwith IMSEMU

A Short Introduction to ArcXML and Reverse

EngineeringPaul Ramsey

Refractions Research

Page 2: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

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.”

Page 3: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

Map Server Languages

• OpenGIS Web Map Server (URL GET)– GETCAPABILITIES– GETMAP– GETFEATUREINFO

• ESRI ArcXML (XML POST)– <GET_SERVICE_INFO>– <GET_IMAGE>– <GET_FEATURES>

Page 4: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

ArcIMS Emulation

• Goal: Speak ArcXML Like a Native

ArcXML

Map

Scrip

t

ESRI ClientArcMap ArcExplorerWeb Page

IMSEMU Mapserver

Page 5: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

Page 6: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

Page 7: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

IMSEMU• Perl CGI• Mapscript• com.esri.esrimap.Esri

map• Requires:

HTTP Server, Perl with, XML::Parser XML::Writer Perl Mapscript

EMU

Page 8: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

ArcIMS Mapserver

ArcIMS• One Server,

Multiple Services• Projection ID• WKT Projection

Mapserver• One Server,

Multiple Map Files• EPSG Number• Proj4 Projection

Page 9: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

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 filesmy @files = (

“92K,26910,/home/www/mapserv/maps/92k.map”,“PGIS,42102,/home/www/mapserv/maps/pgsql.map”);

Page 10: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

IMSEMU Operation• Responds to ArcIMS-style requests

http://mapserver.refractions.net/servlet/com.esri.esrimap.Esrimap?ServiceName=catalog&CustomStream=False

Page 11: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

POST /servlet/com.esri.esrimap.Esrimap ?ServiceName=BCView &CustomStream=False HTTP/1.1Content-Length: 120User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)Host: mapserver.refractions.netConnection: Keep-AliveCache-Control: no-cache

<?xml version="1.0" encoding="UTF-8"?><ARCXML version="1.0.1"><REQUEST dpi="96"><GET_SERVICE_INFO/></REQUEST></ARCXML>

Page 12: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

HTTP/1.1 200 OKServer: Microsoft-IIS/5.0Date: Wed, 24 Oct 2001 17: 08:42 GMTContent-Type: text/plainConnection: Keep-Alive

<?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>

encoding="UTF-8"Causes ArcMap to CRASH

Page 13: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

Learning the Lingo

• Read the ArcXML Reference– google arcxml reference

• Sniff the Wire

ESRI ClientArcMap ArcExplorerWeb Page

ArcIMS

Sniffer

HTTPLookngrep

ArcXML

Page 14: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

HTTPLook

Page 15: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

ngrep

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..

ngrep -d eth0 host 192.168.50.71 and tcp port 80

Page 16: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

perluse LWP::UserAgent;

$url = "http://198.102.62.145/servlet/com.esri.esrimap.Esrimap?ServiceName=ESRI_World&CustomStream=True&ClientLocale=en_US&ClientVersion=3.1";

my $ua = new LWP::UserAgent;

my $req = HTTP::Request->new(POST => $url);

$req->content(qq{<?xml version="1.0" encoding="UTF-8"?><ARCXML version="1.1"><REQUEST><GET_IMAGE><PROPERTIES><ENVELOPE minx="-209.08653257226464" miny="-143.95447414784505" maxx="187.68158936045373" maxy="158.28164557942696" /><IMAGESIZE width="596" height="454" dpi="96" /><LAYERLIST order="true"><LAYERDEF id="V1 Coverage 3" visible="true” /></LAYERLIST></PROPERTIES></GET_IMAGE></REQUEST></ARCXML>});

my $res = $ua->request($req);

if ($res->is_success) { print $res->content;}

dÅ<?xml version="1.0" encoding="UTF-8"?><ARCXML version="1.1"><RESPONSE><IMAGE><ENVELOPE minx="-209.086532572264" miny="-143.954474147845" maxx="187.681589360453" maxy="158.281645579426" />dÓ<OUTPUT file="/net/dbserver/work/common/geonet/maps/ESRI_World_bluemap11910313481.gif" url="http://redlands.geographynetwork.com/out/maps/ESRI_World_bluemap11910313481.gif" /></IMAGE></RESPONSE></ARCXML>f

Page 17: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

00 00 00 64 00 00 00 C5 3C 3F 78 6D 6C 20 76 65 72 73 69 6F ...d....<?xml versio6E 3D 22 31 2E 30 22 20 65 6E 63 6F 64 69 6E 67 3D 22 55 54 n="1.0" encoding="UT46 2D 38 22 3F 3E 0D 0A 3C 41 52 43 58 4D 4C 20 76 65 72 73 F-8"?>..<ARCXML vers69 6F 6E 3D 22 31 2E 31 22 3E 0D 0A 3C 52 45 53 50 4F 4E 53 ion="1.1">..<RESPONS45 3E 0D 0A 3C 49 4D 41 47 45 3E 0D 0A 3C 45 4E 56 45 4C 4F E>..<IMAGE>..<ENVELO50 45 20 6D 69 6E 78 3D 22 2D 32 30 39 2E 30 38 36 35 33 32 PE minx="-209.08653235 37 32 32 36 34 22 20 6D 69 6E 79 3D 22 2D 31 34 33 2E 39 572264" miny="-143.935 34 34 37 34 31 34 37 38 34 35 22 20 6D 61 78 78 3D 22 31 54474147845" maxx="138 37 2E 36 38 31 35 38 39 33 36 30 34 35 33 22 20 6D 61 78 87.681589360453" max79 3D 22 31 35 38 2E 32 38 31 36 34 35 35 37 39 34 32 36 22 y="158.281645579426"20 2F 3E 0D 0A 00 00 00 64 00 00 00 CF 3C 4F 55 54 50 55 54 />.....d....<OUTPUT20 66 69 6C 65 3D 22 2F 6E 65 74 2F 64 62 73 65 72 76 65 72 file="/net/dbserver2F 77 6F 72 6B 2F 63 6F 6D 6D 6F 6E 2F 67 65 6F 6E 65 74 2F /work/common/geonet/6D 61 70 73 2F 45 53 52 49 5F 57 6F 72 6C 64 5F 72 65 64 6D maps/ESRI_World_redm61 70 35 33 37 30 33 31 33 34 33 33 2E 67 69 66 22 20 75 72 ap5370313433.gif" ur6C 3D 22 68 74 74 70 3A 2F 2F 72 65 64 6C 61 6E 64 73 2E 67 l="http://redlands.g65 6F 67 72 61 70 68 79 6E 65 74 77 6F 72 6B 2E 63 6F 6D 2F eographynetwork.com/6F 75 74 2F 6D 61 70 73 2F 45 53 52 49 5F 57 6F 72 6C 64 5F out/maps/ESRI_World_72 65 64 6D 61 70 35 33 37 30 33 31 33 34 33 33 2E 67 69 66 redmap5370313433.gif22 20 2F 3E 0D 0A 3C 2F 49 4D 41 47 45 3E 0D 0A 3C 2F 52 45 " />..</IMAGE>..</RE53 50 4F 4E 53 45 3E 0D 0A 3C 2F 41 52 43 58 4D 4C 3E 0D 0A SPONSE>..</ARCXML>..00 00 00 66 ...f

hexedit197100

102 100 207

Page 18: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

ArcIMS Modes

• ServiceName=catalog• CustomStream=True|False• Encode=True|False• Form=True|False• ClientLocale=en_US• ClientVersion=3.1

Page 19: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

IMSEMU Capabilities

• Image Serving– GET_CLIENT_SERVICES– GET_SERVICE_INFO– GET_IMAGE– FILTER_COORDSYS

(Coordinate Reprojection)– CustomStream=True|False– Encode=True|False

Page 20: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

IMSEMU To Do

• Feature Serving– GET_FEATURE

(default, xml, xmlnew)– SPATIALQUERY / QUERYFILTER

• Image Serving with Selections and Acetates– Inline LAYER objects.

Page 21: ArcIMS Emulation with IMSEMU

OpenSource GIS 2004

Ottawa, Canadawww.refractions.net

Questions?