“错误#1006:getAttributeByQName 不是函数。” Flex 2.0.1 修补程序 2
我正在开发一些旧的 Flex 项目(Flex 2.0.1 hotfix 2),并且我是 Flex 编程的菜鸟。因此,我编写了用于访问某些 ASP.NET Web 服务的代码:
<?xml version="1.0" encoding="utf-8"?>
[Bindable]
public var users:ArrayOfUser;
private function buttonClicked():void
{
mx.controls.Alert.show(dataService.wsdl);
dataService.UserGetAll.send();/
}
public function dataHandler(event:ResultEvent):void
{
Alert.show("alo");
var response:ResponseUsers = event.result as ResponseUsers;
if (response.responseCode != ResponseCodes.SUCCESS)
{
mx.controls.Alert.show("Error: " + response.responseCode.toString());
return;
}
users = response.users;
}
]]>
<mx:Button label="Click me!" click="buttonClicked()"/>
这就是我从调试器得到的结果:
WSDL loaded
Invoking SOAP operation UserGetAll
Encoding SOAP request envelope
Encoding SOAP request body
'A97A2DC1-AEDA-C594-45D2-1BA2B0F3B223' producer sending message '10681130-43E7-3DA7-34DD-1BA2B85545E3'
'direct_http_channel' channel sending message:
(mx.messaging.messages::SOAPMessage)#0
body = "<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<tns:UserGetAll xmlns:tns="http://tempuri.org/"/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>"
clientId = "DirectHTTPChannel0"
contentType = "text/xml; charset=utf-8"
destination = "DefaultHTTP"
headers = (Object)#1
httpHeaders = (Object)#2
SOAPAction = ""http://tempuri.org/UserGetAll""
messageId = "10681130-43E7-3DA7-34DD-1BA2B85545E3"
method = "POST"
recordHeaders = false
timestamp = 0
timeToLive = 0
url = "http://192.168.0.201:8123/Service.asmx"
'A97A2DC1-AEDA-C594-45D2-1BA2B0F3B223' producer acknowledge of '10681130-43E7-3DA7-34DD-1BA2B85545E3'.
Decoding SOAP response
Encoded SOAP response <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><UserGetAllResponse xmlns="http://tempuri.org/"><UserGetAllResult><ResponseCode>Success</ResponseCode><Users><User><Id>1</Id><Name>test</Name><Key>testKey</Key><IsActive>true</IsActive><Name>Petar i Sofija</Name><Key>123789</Key><IsActive>true</IsActive></User></Users></UserGetAllResult></UserGetAllResponse></soap:Body></soap:Envelope>
Decoding SOAP response envelope
Decoding SOAP response body
最后我得到这个错误“错误#1006:getAttributeByQName不是一个函数。”。如您所见,我从 Web 服务获得了正确的响应,但 dataHandler 函数从未被调用。
有人可以帮我吗?
谢谢, 德韦蒂·普特尼克
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过安装 Hotfix 3,我解决了这个问题,因为它从未存在过。
By installing Hotfix 3 I solved the problem as it never existed.