Actionscript Webservice 将结果格式设置为 e4x
我正在尝试在我的 Flex 4 应用程序中使用 Webservice 组件。
我需要在 Actioncript 中使用它而不是使用 MXML 标签。
我能够成功调用 WSDL 操作,但 resultFormat 默认为 Object。
如何将其设置为 e4x?
var lookupService:WebService = new WebService();
lookupService.wsdl =url;
lookupService.loadWSDL();
lookupService.doLookup.addEventListener(ResultEvent.RESULT, lookupResultHandler);
lookupService.doLookup.addEventListener(FaultEvent.FAULT, faultHandler);
lookupService.doLookup(lookupString);
我尝试通过设置格式
lookupService.resultFormat = "e4x";
但这不起作用。当我这样做时,电话甚至都没有接通。
您能否提供使用 AS3 实现此功能的建议?
I'm trying to use Webservice component in my Flex 4 application.
I need to use this in Actioncript and not using MXML tags.
I'm able to invoke the WSDL operations successfully, but the resultFormat is Object by default.
How do I set it to e4x?
var lookupService:WebService = new WebService();
lookupService.wsdl =url;
lookupService.loadWSDL();
lookupService.doLookup.addEventListener(ResultEvent.RESULT, lookupResultHandler);
lookupService.doLookup.addEventListener(FaultEvent.FAULT, faultHandler);
lookupService.doLookup(lookupString);
I tried to set the format by
lookupService.resultFormat = "e4x";
But this is not working. The calls are not even going through when I do this.
Can you please provide your suggestions for implementing this using AS3?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您看一下两个 网络 服务 类,您会意识到 resultFormat 不是它们中任何一个的属性。结果集是操作的属性 数组。
如果这没有帮助,你就必须量化“不起作用”。什么不起作用?您遇到编译错误吗?您遇到运行时错误吗?数据没有返回吗?数据不是以 XML 形式返回吗?
您可能必须在 MXML 中进行设置并剖析生成的 ActionScript 以找出适当的 AS3 语法。
http://help.adobe.com /en_US/FlashPlatform/reference/actionscript/3/mx/rpc/soap/WebService.html
If you take a look at the two web service classes, you'll realize that resultFormat is not a property on either of them. Resultset is a property on the operations array.
If that doesn't help, you'll have to quantify "not working." What isn't working? Are you getting compile errors? Are you getting runtime errors? IS the data not being returned? Is the data not be returned as XML?
You'll probably have to set this up in MXML and dissect the generated ActionScript to figure out the appropriate AS3 syntax.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/rpc/soap/WebService.html