I've been experimenting quite a bit recently with MapDotNet Server 2007 (from hereon, referred to as MDNS), and I'll say that I'm pretty impressed. Building maps in MDNS is admittedly more difficult than simply publishing an .mxd with ArcGIS Server - MDNS uses MapServer's map file format, but the power of gaining access to Virtual Earth base data far outweighs the trouble that it takes to build the application and the performance is killer when compared to the alternatives. One thing I've noticed, though, is that the documentation/support site for MDNS still needs a lot of work. It's obvious that ISC has put some work into their help in the recent past, but there are still lots of topics that need to be covered in much more detail.
One of the topics that is only briefly covered in the support portal wiki is integrating ArcSDE with an MDNS application. The steps are briefly outlined in the "ArcSDE Integration" wiki entry, but there really needs to be a comprehensive step-by-step walkthrough for a topic as important as this. If it were a true wiki, I would be able to edit the page and update the documentation for others to use, but I have yet to find a way to contribute. So I'm going to put up my little walkthrough here (as much for myself as for anyone else) and hope that it either gets integrated into the support site or that ISC updates their documentation soon.
There are three steps to the process, first you need to download the "libmap.dll.sde92" dll (it wasn't included with the MDNS 2007 6.0 release for some reason), second you need to enable ArcSDE connections via MapDotNet Server 2007, and last you need to connect your specific application to an SDE geodatabase. Make sure that you perform all of the steps on both your development machine and your web server.
- Download the "libmap.dll.sde92" dll:
- Click on the following link to download a .zip with the dll in it.
- Unzip the dll and put it in the "\IGNORED_LIBMAP_DLLS" directory, which is located at "C:\Program Files\MapDotNet Server\v6.0\MapDotNetServer Web Service\bin\IGNORED_LIBMAP_DLLS" in a default install.
- Enable ArcSDE Connections via MapDotNet Server 2007:
- Install the ArcSDE 9.2 C SDK:
- The C SDK is included with your ArcSDE 9.2 install media.
- Initiate the install by either inserting the disk and using the Autorun installation GUI or browsing to the "\ArcSDE\windows\ArcSdeSDK" directory and double-clicking "setup.exe".
- Choose "ArcSDE C SDK" from the installation window and let it run to completion.
- Add a Path variable to point to the ArcSDE\bin directory:
- In Windows, right-click on "My Computer" and select "Properties" from the context menu.
- Click on the "Advanced" tab and then the "Environment Variables" button near the bottom of the window.
- In the "System variables" section, scroll down to the "Path" variable and double-click it to open the "Edit System Variable" window.
- Go all the way to the end of the "Variable value:" field and add the following to the end: ";C:\ArcGIS\ArcSDE\bin" (without the quotations).
- Click "OK" three times to exit out of all the dialogs.
- Reset IIS by opening up a command line and running "iisreset".
- Browse to the "\IGNORED_LIBMAP_DLLS" directory, which is - again - located at "C:\Program Files\MapDotNet Server\v6.0\MapDotNetServer Web Service\bin\IGNORED_LIBMAP_DLLS" in a default install, and copy and paste the "libmap.dll.sde91" dll into the "\bin" directory.
- Stop the "World Wide Web Publishing" service, as it likely has a lock (via the aspnet_wp) on the "libmap.dll":
- Right-click on "My Computer" and select "Manage".
- Expand the "Services and Applications" console.
- Click on "Services".
- Scroll down to the bottom, right-click on "World Wide Web Publishing", and select "Stop" from the context menu.
- Cut and paste the "libmap.dll" dll from the "\bin" directory into the "\IGNORED_LIBMAP_DLLS" directory (just for safe-keeping).
- Rename the "libmap.dll.sde92" dll that you placed in the "\bin" directory to "libmap.dll".
- Restart the "World Wide Web Publishing" service:
- Back in "Computer Management" (see #3 above), restart the service by right-clicking on it and selecting "Start" from the context menu.
- Connect Your Application to an SDE Geodatabase:
- Open your application's .map file using either the "MapFile Generator" or your preferred text editor.
- Add a new layer to your .mapfile, using the following connection information (replace the red with your data source information):
CONNECTION "SERVER,port:PORTNUMBER,DATABASE,USERNAME,PASSWORD"
CONNECTIONTYPE SDE
DATA "DATABASE.USERNAME.NAMEOFFEATURECLASS,SHAPE,SDE.DEFAULT"
PROCESSING "CLOSE_CONNECTION=DEFER"