I use WebServiceProxy.invoke to call a webservice Method. I realized that one of the parameter is a function to handle error that coming when the method throw an exception.
我尝试了get_message()的方法,以获取错误信息。 当我从当地人那里获得这一机会时,这种工作就告别。 但是,当我从遥远的计算机中获取这一方法时,电文因标准错误而改变:。
callws = function (args) {
// call webservice to fill content panel
Sys.Net.WebServiceProxy.invoke(_servicePath, _serviceMethod, false,
{ contextKey: args }, Function.createDelegate(this, onSubmitComplete),
Function.createDelegate(this, onSubmitError), args);
}
onSubmitComplete = function (result, userContext, methodName) {
...
}
onSubmitError = function (result, userContext, methodName) {
// note: this result.get_message() contain exception message when
// accessed from localhost, but contain "There was an error processing the request"
// when accessed from remote computer
alert(result.get_message());
}