问题描述
试试 Hi, try { 返回 存款 .retrieve(SPARM); } return Deposit.retrieve(sParm); } catch ( 例外 e) { catch (Exception e) { SoapException soapEx = new SoapException (e.Message, SoapException SoapException soapEx = new SoapException(e.Message, SoapException.ClientFaultCode); throw soapEx; } throw soapEx; } 这篇关于Webservice自定义SoapException抛出导致HTTP500错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
我有一个包含webmethod的web服务,如果参数验证失败,它应该抛出异常。
但是,当抛出异常时(我用调试器检查过)客户端浏览器上显示的所有内容都是HTTP 500错误。
未显示异常的自定义消息。
代码段:
I have a webservice that contains a webmethod which should throw an exception if parameter validation fails.
However, when the exception is thrown (which I checked with the debugger) all that shows on the client browser is an HTTP 500 error.
The custom message of the exception doesn't appear.
Code snippet :
在VS2005 / VS开发服务器上运行,XP Pro
谢谢,
MetaMeta
什么我做错了吗?
Running on VS2005/VS Development Server, XP Pro
Thanks,
MetaMeta
What did I do wrong ?推荐答案