Archive for April, 2007

Updated: Open-source OGC CSW client?

April 24, 2007

I’ll keep this one short and sweet.  There are some interesting open-source CSW (Catalogue Service for the Web) server options.  Can anyone point me to open-source OGC CSW clients?

 UPDATE:

http://geonetwork-opensource.org/ Version 2.1 (in Beta) will come with both server and client support for CSW.  You can head over to http://sourceforge.net/projects/geonetwork and grab it today.  The only caveat is that its GPL’ed … which doesn’t make distributing ESRI+CSW binary plugins feasible.

 Deegree also has a client, in the org\deegree_impl\clients\wcasclient branch.  The advantage of it is that its LGPL.  The disadvantage is that (I have no idea how to run it and) it has a class named “AddToShoppingCartListener.”  Forgive me for not knowing how that pertains to a Catalogue Service.

ArcIMS Emulator

April 24, 2007

Paul Ramsey at Refractions Research has a very interesting little gem called ArcIMS Emulator.

 The basic idea is to allow the impersonation of ArcIMS Image and Feature services by Mapserver.  Much of the gusto here is the cleanest effective documentation of ArcIMS’s binary secret-handshakes.

But why would anyone want to emulate ArcIMS now that ESRI supports WMS services? 

You could say because Mapserver is free, open-source, faster than ArcIMS, and reasonably easier to get improvements / fixes on (“ArcIMS has been moved from an active development effort to a maintenance project”).

I’ll focus on another issues: ArcMap does not support WFS nor authenticated WMS.  New in ArcMap 9.2 is the ability to connect to a secure data service via HTTPS.  Combine secure transport with authentication and you have ESRI’s first usable, secure data-delivery mechanism to ArcMap.

 I’ve previously written how ArcIMS has a rather lame integration of Access Control Lists, and how you can easily route traffic through an authentication proxy.  If you have to proxy ArcIMS to get meaningful authentication anyway, why not proxy Mapserver/WMS/WFS instead? 

 ArcIMS Emulator is 120kb of Perl… I bet you’ll see a 120kb of C# coming soon.  Sean Gillies has already ported it to Python, although “PyIMS”seems to have passed away.  Anybody else interested in seeing secure, open-source data delivery to ArcMap with robust, integrated authentication?

Scrappad: ArcGIS Server 9.2 With A Reverse Proxy

April 16, 2007

There’s a nice write-up on Scrappad concerning Configuring ArcGIS Server 9.2 For .NET To Work With A Reverse Proxy .

It references an ESRI article that talks about using Apache for the reverse proxy. Scrappad recommends Microsoft’s ISA server for the same deal. If you’re in an IIS setting and that’s outside your price range, I recommend taking a look at the article I wrote on proxying ArcIMS traffic using ASP.NET HttpHandlers.

Authenticate ArcIMS Traffic Via an ASP.Net Proxy

April 6, 2007

ArcIMS makes an interesting datasource for ArcMap clients, but I have a hard time liking its login options. That is, it just really doesn’t integrate well with — oh — just about any existing security system.

This is a little mockup showing how you can proxy ArcIMS traffic through an ASP.Net HttpHandler. Moreover, this shows how to force ArcMap clients to authenticate.

I’ve removed much of the guts, but it works. Please forgive the screwy code styling. I’m still learning this blogging thing.

Basic Setup

Create a virtual directory “servlet” as an IIS application, and add the below files there.
Enable basic authentication, but keep anonymous access on.
Add a mapping for “.Esrimap” to .NET’s “aspnet_isapi.dll” handler.


WEB.CONFIG


<?xml version="1.0"?>

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"><

appSettings><add key="RemoteWebSite" value="10.147.156.69:8080"/></appSettings> 

<system.web>  

<compilation defaultLanguage="c#" />   

<authentication mode="Windows"/>  

<httpHandlers> <add verb="*" path="com.esri.esrimap.Esrimap" type="Proxy, App_Code"/> </httpHandlers>  

</system.web>  

</configuration>



PROXY.CS

using System;
using System.Configuration;using System.Web;
using System.Net;using System.Text;
using System.IO; /// <summary>/// Web Proxy for ArcIMS traffic that employs ASP.NET Authentication mechanisms
/// </summary>public class Proxy : IHttpHandler
{
public void ProcessRequest(HttpContext context){ // Grab our real ArcIMS server's information from the web.config filestring remoteWebSite = ConfigurationManager.AppSettings["RemoteWebSite"];string remoteUrl = "http://" + remoteWebSite + context.Request.RawUrl; 
// Convince ArcMap clients to send credentials
if (!context.Request.IsAuthenticated && context.Request.QueryString.ToString() != "cmd=ping"){context.Response.Status = "401 Unauthorized";context.Response.Write("<?xml version=\"1.0\"?>n<ARCXML><RESPONSE><ERROR>You are not authorized to access this ArcIMS Service.</ERROR></RESPONSE>n</ARCXML>");context.Response.End();
  

return;}   

// Create a web connection to the real ArcIMS server  

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(remoteUrl);request.Method = context.Request.HttpMethod;   

// Post any ArcXML to the real ArcIMS server  

if (context.Request.HttpMethod == "POST"){Stream sendStream = request.GetRequestStream();byte[] buff2 = new byte[1024];
  

int bytes2 = 0;while ((bytes2 = context.Request.InputStream.Read(buff2, 0, 1024)) > 0){sendStream.Write(buff2, 0, bytes2);  

}  

sendStream.Close();  

}  

// Recieve an ArcXML response from the real ArcIMS server  

HttpWebResponse response = (HttpWebResponse)request.GetResponse();Stream receiveStream = response.GetResponseStream();byte[] buff = new byte[1024];int bytes = 0;
  

while ((bytes = receiveStream.Read(buff, 0, 1024)) > 0){context.Response.OutputStream.Write(buff, 0, bytes);  

}  

response.Close();  

context.Response.End();  

}  

public bool IsReusable{get  

{
return true;}}  

}