hopkinst

Problems installing ArcGIS Javascript API 1.6 on IIS

Discussion created by hopkinst on Apr 5, 2010
Latest reply on Apr 10, 2012 by varun123
I was able to successfully install ArcGIS Javascript API version 1.6 on our Tomcat (6.0.18) server by following some instructions someone posted on the old forums.  However, I have not been able to get this same version to install corretly into IIS.

I followed the instructions that came with the DVD but have not be able to get it to work correctly.  When I access the version installed on Tomcat with Firefox 3.6 it spits out a config file, when I view the same version installed on IIS with the same version of Firefox it gives me a 404 page cannot be found error.  I even turned directory browsing on in IIS and opened the file that way with the same error.

I'm using the Default.ashx that came with the installation DVD (code posted below).  IIS is running on a Windows Server 2003 R2 Enterprise x64 Edition with Service Pack 2 with .NET 2.0 SP2, .NET 3.0 SP2 and 3.5 SP1 installed.

--------------------------------
Default.ashx code
--------------------------------
<%@ WebHandler Language="C#" Class="jsapi" %>

using System;
using System.Web;
using System.IO;

public class jsapi : IHttpHandler {
  public void ProcessRequest (HttpContext context) {
 
    // GZIP if supported
    string AcceptEncoding = HttpContext.Current.Request.Headers["Accept-Encoding"];
    if (!string.IsNullOrEmpty(AcceptEncoding) && AcceptEncoding.Contains("gzip")) {
      context.Response.AppendHeader("Content-Encoding", "gzip");
      context.Response.Filter = new System.IO.Compression.GZipStream(context.Response.Filter, System.IO.Compression.CompressionMode.Compress);
    }

    context.Response.ContentType = "application/x-javascript";
    context.Response.Expires = 1800;

    context.Response.WriteFile(context.Server.MapPath("js\\dojo\\dojo\\dojo.xd.js"));
    context.Response.WriteFile(context.Server.MapPath("js\\esri\\esri.js"));

    context.Response.Write("(function() {var dojo = window[esri._dojoScopeName];var dijit = window[esri._dijitScopeName];var dojox = window[esri._dojoxScopeName];");
    context.Response.WriteFile(context.Server.MapPath("js\\esri\\jsapi.js"));
    context.Response.Write("}());");               
  }

  public bool IsReusable {
    get {
      return false;
    }
  }
}

Outcomes