Saturday, March 24, 2012

Deployment Problem

I'm a very new user of Atlas. I have a .NET application where I wanted to do some AJAX and Atlas seemed like a great choice. It was pretty simple to create a web service and get it accessible to my application through Atlas on my development PC.

But now that I'm trying to get it on the production server, I'm running into some problems that I can't overcome - after about 8 hours of trying. I've read through the forums and Googled before this post - but hopefully I'm just missing something silly that someone can help me with. I'm at my wits end!

The application is unable to access the web service (update.asmx) with the /js tag appended. If I run Fiddler, I see the application does attempt to connect to update.asmx/js. But I get a 500 error. If I connect the update.asmx, I get the expected Service Description and it seems to be working. If I connect to update.asmx/js, I get a "Server Error in '/' Application" page back. Doing this on my development box, I see the appropriate JavaScript that Atlas provides to register the service.

I haven't been able to determine the cause. ASP.NET 2.0 is installed on the server - the TreeView control works within my application and the error page when I try to access update.asmx/js indicates ASP.NET Version:2.0.50727.42. This is a Windows 2003 SP1 Server w/ IIS 6. I verified that I completed all tasks from the installation document on integrating Atlas into an existing application. I'm appending my Web.Config file to the end of this post.

Please let me know what direction to go next to troubleshoot the problem. I've been banging my head on this one for a long time. Thanks a lot in advance!

Here is my Web.Config file:

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<configSections>
<sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup">
<section name="converters" type="Microsoft.Web.Configuration.ConvertersSection"/>
</sectionGroup>
</configSections>
<microsoft.web>
<converters>
<add type="Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/>
<add type="Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/>
<add type="Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/>
</converters>
</microsoft.web>
<appSettings/>
<connectionStrings>
<add name="NetworkConnectionString" connectionString="Data Source=server1;Initial Catalog=Network;Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="RADConnectionString" connectionString="Data Source=server2;Initial Catalog=db;Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="STConnectionString" connectionString="Data Source=server1;Initial Catalog=ST;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<pages>
<controls>
<add namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
<add namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
</controls>
</pages>

<!-- ASMX is mapped to a new handler so that proxy javascripts can also be served. -->
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="Microsoft.Web.Services.ScriptModule"/>
</httpModules>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" defaultLanguage="c#" urlLinePragmas="true">
<assemblies>
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
-->
</system.web>
</configuration>

I forgot to mention that I also uninstalled and reinstalled the .NET framework in troubleshooting the problem and created a new web site with \inetpub\wwwroot. Neither of these helped.

And to answer my own question, I was missing a few lines in the Web.Config file.

In the <configSections> section I needed:

<

sectionname="webServices"type="Microsoft.Web.Configuration.WebServicesSection"requirePermission="false" />

And in the <microsoft.web> section I needed:

<

webServicesenableBrowserAccess="true" />

This got me working correctly.

No comments:

Post a Comment