tags:

views:

18

answers:

1

Using .net 4.0 , IIS 7.4 Windows Server 2008 R2

I have an asp.net application that sits between WCF web services and routes the requests according to some rules.

The iis error page setting is set to 'Detailed errors for local requests and custom ....'

the asp.net routing service calls the WCF service using HttWebRequest object.

I am getting an iis html error response when wcf service throws a fault exception.

but i get a proper IIS 500 error with a proper soap response when i call the service directly (without the router)

I know i can fix it by changing IIS error page setting, but i dont want to do that since it would expose my non wcf errors.

question is

  1. is there a difference in how iis treats wcf requests vs asp.net request when it comes to 500 errors

  2. also this used to work in IIS 6, how to get this behavior back in iis 7

A: 

You should leave ASP.NET out of the picture. Create a WCF service to stand between the two services. You can copy the routing logic from your existing ASP.NET router. The WCF service should just use "Add Service Reference" to talk to the two services.

Alternatively, just use "Add Service Reference" yourself in the ASP.NET router.

John Saunders
unfortunately our services rely on certain http headers, and its a huge undertaking to change, is asp.net pipleline completely different than wcf ? howcome iis treats wcf 500 differently than asp.net 500
I don't know how IIS treats them differently, or even if IIS is involved. Possibly because the body of the response contains SOAP instead of HTML? WCF is very extensible. I'm sure you can process the headers using WCF. I don't know the exact technique, but I'm sure you can do it. I know that a WCF Message Log, when enabled, contains HTTP header information, so that proves WCF doesn't just throw headers away. They might be stored in the Properties property of the incoming Message object.
John Saunders