我正在使用我的flex应用程序中的webservice组件,但是当通过我的应用程序使用相同的webservice调用时,我发现im一次又一次地使用相同的代码。
有没有创建webservice组件的最佳实践?我应该把所有的代码放在一个actionscript类中吗?如果是这样的话,你有什么示例吗?
发布于 2009-02-03 22:15:29
您可以考虑为您的web服务创建代理类。Flex3 builder会自动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
}https://stackoverflow.com/questions/509078
复制相似问题