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関数が呼び出されることはありません。

誰でも私を助けてもらえますか?

ありがとう、デベティ・プットニク

4

1 に答える 1

0

Hotfix 3をインストールすることで、問題が存在しなかったため解決しました。

于 2010-06-09T11:08:50.817 に答える