“错误#1006:getAttributeByQName 不是函数。” Flex 2.0.1 修补程序 2

发布于 2024-09-05 06:26:01 字数 3075 浏览 4 评论 0 原文

我正在开发一些旧的 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 函数从未被调用。

有人可以帮我吗?

谢谢, 德韦蒂·普特尼克

I am working on some old Flex project (Flex 2.0.1 hotfix 2) and I am rookie in Flex programming. So, I wrote code for accessing some ASP.NET web service:

<?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()"/>

And this is what I get from debugger:

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

And finally I get this error "Error #1006: getAttributeByQName is not a function.". As you can see, I get correct response from web service, but dataHandler function is never got called.

Can anyone please help me out?

Thanks,
Deveti Putnik

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

本宫微胖 2024-09-12 06:26:01

通过安装 Hotfix 3,我解决了这个问题,因为它从未存在过。

By installing Hotfix 3 I solved the problem as it never existed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文