Problems with SoapExceptions in custom HttpModule

Discussion in 'ASP .Net Web Services' started by cj, Oct 11, 2005.

  1. cj

    cj Guest

    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
     
    cj, Oct 11, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWljaGFlbCBJYW50b3NjYQ==?=

    Accessing Custom Attributes in an HttpModule

    =?Utf-8?B?TWljaGFlbCBJYW50b3NjYQ==?=, Jan 15, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    997
    Sami Vaaraniemi
    Jan 16, 2004
  2. Gilles
    Replies:
    3
    Views:
    2,650
    =?Utf-8?B?Lk5ldE5ld2JpZQ==?=
    Sep 30, 2004
  3. Mike Kline
    Replies:
    1
    Views:
    589
    John Saunders
    Jan 7, 2005
  4. carl
    Replies:
    0
    Views:
    106
  5. Rachit  Samwalla

    How to wrap all SoapExceptions

    Rachit Samwalla, Feb 3, 2005, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    123
    Bruce Johnson [C# MVP]
    Feb 3, 2005
Loading...

Share This Page