views:

332

answers:

3

Hi all,

We have a web application where we are using global.asax for url rewriting. We use a compiled version of the site on the live server.

As a part of modification request, we had to add some custom native AJAX code where javascript would call a webservice to update the content of the page. For being able to call the webservice with extension .asmx, we modified the url rewriting code to handle asmx requests seperately.

this arrangement works fine on the local machine, but when we publish the site and deploy it on the live server, the new code doesnt seem to get included. It still skips the condition to check the ".asmx" extension, and throws a page not found exception considering the webservice name as a page name.

We have tried looking all over and googled for such things as well.. but no avail.. any pointers on what might be going wrong.. ?

A: 

Assuming your URL rewriting is good (isn't that normally implemented as a HttpModule?) I'd check to make sure that there's an ISAPI mapping in IIS on production that sends .asmx requests to ASP.NET.

If you think your changes to the global.asax haven't been rejitted then you can always stop the application pool, go find your web applications compiled bits in c:\windows\microsoft.net\framework[version]\temporary asp.net files... and delete the jitted version. I've seen ASP.NET miss when it comes to Jitting changes before.

I'd also consider running http fiddler (IE) or tamper data (FireFox extension) on one of the pages that makes calls to the web service. It will tell you exactly how the page is calling the web service and you can validate that the called URL is correct.

Tyler
yes, we have checked it.. its there..
Danish
Also.. URL rewriting is working fine for all other requests. We suspect that the global.asax is not being modified when we publish the site, its somehow using the old version of the same ..
Danish
move the handling to an httpmodule, and triple check the mapping to asp.net exists in IIS
annakata
A: 

There is machine.config file where you can add HttpModules. I also think that you can do that through web.config.

uriDium
you absolutely do not want to modify machine.config for this since the handler is application dependent, but yes he should be using web.config
annakata
A: 

One reason I can think of is that in the Web.config, you might have configured the routing module in the system.web section but not in system.webServer (or at least forgot something in there).

I the similar problem before and the solution was to remove the module & add it again in the system.webServer section of the Web.config like this:

<system.webServer>
    <modules>
      <remove name="UrlRoutingModule" />
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, e="RoleManager" type="System.Web.Security.RoleManagerModule"/>
    </modules>
</system.webServer>

It might be a different module or handler but the idea is basically the same. It's important to "remove" the module first.

Loki