0

Flex 4 AIR アプリケーションで Pingdom API を使用し、Flash Builder 4 に組み込まれた Data/Services ビルダーを使用しています。Pingdom の API は SOAP 上に構築されており (少なくとも今のところ)、Flash Builder 4 は WSDL をインポートできました。ファイルは問題ありませんが、トークンで Auth_login リクエストを送信しようとすると、結果変数が null になります。間違った場所を探しているのか、それとも何なのかわかりません。正確には、値の Auth_loginResult.token.result を見ています。

token.result は正しい場所ですか? 結果が null の場合、null の理由を突き止めます。つまり、WSDL が使用可能かどうか、およびそれが有効な要求かどうかを確認します。

アプリがオンラインであることを確認するために、アプリでネット モニターを実行しています。

ログインプロセスの私のコードは次のとおりです

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:pingdomapi="services.pingdomapi.*"
        title="Login">
    <fx:Script>
        <![CDATA[
            import valueObjects.Auth_CredentialsData;


            protected function login(event:MouseEvent):void
            {
                var credentials:Auth_CredentialsData = new Auth_CredentialsData;
                credentials.username = txt_username.text;
                credentials.password = txt_password.text;
                Auth_loginResult.token = pingdomAPI.Auth_login('****',credentials);
                trace(Auth_loginResult.token.result);
            }
        ]]>
    </fx:Script>
    <fx:Declarations>
        <s:CallResponder id="Auth_loginResult"/>
        <pingdomapi:PingdomAPI id="pingdomAPI"/>
    </fx:Declarations>
    <s:Label x="10" y="10" text="Username"/>
    <s:TextInput id="txt_username" x="10" y="41" text="david.long@cagedata.com"/>
    <s:Label x="10" y="104" text="Password"/>
    <s:TextInput id="txt_password" x="10" y="135" displayAsPassword="true" text="Simpsons#1"/>
    <s:Button id="btn_login" y="198" right="30" label="Login" click="login(event)"/>
</s:View>
4

3 に答える 3

0

Pingdom API WSDL にエラーがあるようです。エラーを報告し、今後の REST API で修正されることを期待しています。

于 2011-02-22T15:55:07.813 に答える
0

この質問は放棄されましたが、誰かが同じ質問で通り過ぎるかもしれません.

結果が null である理由は、呼び出しが非同期であるためです。デイブが追跡しようとしたとき、応答はまだ到着していませんでした。

代わりに、次のように、Auth_loginResult CallResponder の結果および/またはエラー ハンドラをトレースします。

<s:CallResponder id="Auth_loginResult" result="trace(event.result)" error="trace(event)"/>
于 2012-09-08T10:02:14.697 に答える
0

thisによると、Auth_LoginResponse の sessionId 要素を探す必要があります。

于 2011-01-24T08:40:02.770 に答える