Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SoapException

Status
Not open for further replies.

sjakiePP

Programmer
Apr 6, 2004
104
NL
Hi,

I am building a webservice, but I have a problem. When an error occurs I create and throw SoapExceptions. From the webmethods these are also thrown. But in my browser I only get a 500 http error. Is this normal or am I doing something wrong? Do I have to get the Soap Fault in my browser?

Thanks in advance
Sjakie.

----------
Yes, the world is full of strange people.
 
What are the settings for the customErrors element in your web.config. If these are set to 'on' (or remoteOnly if your accessing the web service from a different machine) but no defaultRedirect is supplied then this could have the effect your describing.

Rob

Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
 
My custom errors was <customErrors mode="RemoteOnly"/>.

I have changed it to <customErrors mode="On"/>, but still I receive a 500 http error.

Sjakie

----------
Yes, the world is full of strange people.
 
Try setting it to 'off' this should work. You can use customErrors to deliver a customised 404, 500 page etc to the user as you would have done via settings in IIS for ASP. If you don't have a defaultRedirect page set and have customErrors switched on you will get the defualt 404 or 500 page from IIS instead of the Framework error page with the details of the exception thrown. (I think - admittedly i haven't tested it but i'd be surprised if the behaviour wss different)

Rob

Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
 
Nope, it still didn't work.

Could it be normal behavior? That when I throw a SoapException you always get a 500 error instead of the soap fault xml file?

Sjakie

----------
Yes, the world is full of strange people.
 
Sorry, never thrown a SoapException explicitly so can't be sure. What happens if you throw a different exception - do you still get 500 or is it only for SoapException?

Rob

Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
 
I have tried it with an Exception. But all exception are transformed in to SoapException, so it doesn't matter wich Exception you throw.

I have also tried to create the SoapException in a different way. With the same result.

Aren't there tools to accomplish this?

Sjakie

----------
Yes, the world is full of strange people.
 
Sjakie,

If you're using IE, you can turn off Friendly HTTP Error Messages. Go to Tools/Internet Options/Advanced Tab.

Uncheck "Show Friendly HTTP error messages" in the browsing section.

HTH,

Keith
 
With that I get the exception with the message and the stack trace. It will do for debugging and testing purposes.

Thanks

Sjakie.

----------
Yes, the world is full of strange people.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top