It looks like there's no handling for server side errors at this point at least for the Web Service behavior. If I do the following:
[WebMethod]
publicbusCustomer GetCustomer()
{
thrownewSoapException("Failure dude!",SoapException.ServerFaultCode);
returnnewbusCustomer();
}
The call simply doesn't complete to any of the callbacks. Is there anyway to get any error info out of this? It seems to me that the result values should either include some sort of complex object that contain a reference to an error object or else provide some sort of other mechanism that notifies you of an error. Instead of a Timeout method, maybe there should be a more general Error method with an error object you can query for what type of error occurred on the server.
Hello
Try this on the client side javascript:
function displayTimeout(result)
{
alert('timeout:\n' + result);
}
function dispalyError(result)
{
alert('error:\n' + result);
}
function callMyWebservice()
{
GetCustomer(CallbackMethod,displayTimeout,displayError);
}
You can also use Fiddler to view the data returned from the Webservice. (www.fiddlertool.com)
Hi,
following the suggestion given by donaldduck1312, you have to declare an error callback for the asynchronous request. When the callback is invoked, you receive a Web.Net.MethodRequestError instance as the first parameter; this object has methods that allow to display infos about the error:
function onError(e) {
alert('Server Error: ' +
e.get_exceptionType() + '\r\n' +
'Message: ' +
e.get_message() + '\r\n' +
'Stack Trace: ' +
e.get_stackTrace());
}
No comments:
Post a Comment