Atlas在页面用JavaScript调用WebService方法的参数
WebService Class Name.WebMethod Name
(
Method Parameters, onMethodComplete,
onMethodTimeout,
onMethodError,
onMethodAborted,
userContext,
timeoutInterval,
priority,
useGetMethod,
);
注意:1、Web Method中如果多个参数则用逗号隔开;
2、Atlas调用的WebService里的所有参数必须按照顺序排列;
参数说明如下:
- onMethodComplete:指定当该方法顺利完成并返回时被触发的回调函数名,一般情况下您应该总是指定这个方法。
- onMethodTimeout,:指定当该方法执行超时时被触发的函数名。
- onMethodError:指定当该方法在执行中遇到异常时被触发的函数名。
- onMethodAborted:制定当该方法执行期间被用户取消时被触发的函数名。
- userContext:用户上下文对象,在上述四个函数中都可以访问到。
- timeoutInterval:设定超时的时间限制,单位毫秒,默认值好像为90000。一般情况下不需要更改。
- priority:设定该方法的执行优先级。该优先级将被用于批量AJAX操作(将在下一篇中提到)中。
- useGetMethod:是否采用HTTP GET来发送请求,默认为false。
上述这八个属性的顺序必须按照指定的来。但有时候我们只需要指定顺序靠后的某个参数,就不得不同时书写前面的参数。为此,Atlas特意为我们提供了另一种调用方法,将上述八个参数以dictionary的形式传给该方法。例如当我们只需要onMethodComplete和timeoutInterval参数时,可以这样写:
WebService Class Name.WebMethod Name
( Method Parameters,
{
onMethodComplete: completeHandler,
timeoutInterval: 10000
});