If you can, use a try-catch block.
如果能,那么使用try - catch块。
If the content isn't supported, the code throws an exception, which is caught by the try-catch block.
如果内容不受支持,那么代码抛出一个异常,此异常由try - catch块捕捉到。
From the SOAP client perspective, it's a good idea to wrap the SOAP call inside a try-catch block, so that SOAP faults like the one above can be caught and handled gracefully.
对于SOAP客户端来说,将这个SOAP调用封装在一个try - catch代码块中是很好的做法,这样类似于上面的SOAP错误就会被顺利地捕捉和处理。
应用推荐