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>