0
即时通讯在我的Flex应用程序中使用webservice组件,但发现即时通过我的应用程序使用相同的webservice调用时,一遍又一遍使用相同的代码。flex 3 webservices
是否有创建webservice组件的最佳做法?我应该把所有的代码放在动作类中,如果有的话,你有没有样本?
即时通讯在我的Flex应用程序中使用webservice组件,但发现即时通过我的应用程序使用相同的webservice调用时,一遍又一遍使用相同的代码。flex 3 webservices
是否有创建webservice组件的最佳做法?我应该把所有的代码放在动作类中,如果有的话,你有没有样本?
您可以考虑为您的Web服务创建代理类。 Flex 3自动生成器does it for you但我发现它非常臃肿。你可以看看它并创建你自己的简单代理。
我通常创造一个像这 -
public function GetProducts(id:String, onSucess:Function, onFailure:Function) {
//1. Create web service component and set properties
//2. Call the WS and get a token
//3. Add a responder to the token with closures wrapping onSuccess and onFailure
}
你觉得什么样的事情自己重复方法开始?您可能会发布一些示例代码,并附上一些设计说明,以获得更清晰或更具体的反馈。 – 2009-02-03 22:08:25