简体   繁体   中英

Throw an exception in one solution and catch it in another solution

我有两个项目解决方案,一个用于WebService,另一个用于WebApplication.i遇到了一种情况,我必须在WebService项目中抛出异常(如果发生)并在我的WebApplication方法中捕获它,调用WebService的方法。我可以实现这个..

Throwing an exception from a web service to a client is not advisable. A better approach would be to catch the exception in your web service and write it into your response object that you return to the client.

The client can then check whether the response contains an exception and do what ever you require.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM