Problems with SoapExceptions in custom HttpModule

C

cj

Hi,
I wrote a custom HttpModule for my ASP.NET XML web service so that I could
do custom user authentication via SOAP headers. I have this working except
for one problem: When I throw SoapExceptions from my HttpModule, the
response is sent back to the client as html instead of xml.

This results in the client throwing an exception that the content type is
'text/html', not 'text/xml':
"Client found response content type of 'text/html; charset=utf-8', but
expected 'text/xml'."

If I throw a SoapException from the web service code itself, it works fine.
Unfortunately, the HttpModule has more information about the error, and I
really don't want to enter the web service code if the user is not
authenticated - e.g. I would like to throw an exception!

Anyone know why this might happen? Do I have to write my own custom SOAP
envelope code or something?

Thanks,
cj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,828
Latest member
LauraCastr

Latest Threads

Top