Zend AMF から受け取った後、Flex オブジェクト (ArrayCollection) の値にアクセスできません。送信される元の型は PHP 連想配列で、次のように単純に返されます。
return $this->sections['initial_setup'];
PHP 変数ビュー:
送信される必要な結果は、Charles AMF RPC タブで次のようになります。
しかし、Flex でデータを Object (または String[] - 関係ありません) として受け取ると、そのようなコードでプロパティ値にアクセスできません。
var result:Object = event.result;
if (result['database'] == 'yes' && result['admin'] == 'yes')
// continue branch ...
そして、if-lineで例外が発生します:
Error: Unknown Property: 'database'.
at mx.collections::ListCollectionView ...
最後に、Eclipse 変数ビューで、ResultEvent インスタンスが長さ 0 の ArrayCollection 型の結果を保持し、受け取った値が D アイコンで表示されることを確認できます (D 装飾の意味がわかりませんでした)。
しかし、なぜ私はまだそれらにまったくアクセスできないのですか?それらを使用するにはどうすればよいですか?
Object の代わりに Array または ArrayCollection の型を変更しようとしました。同様の問題について議論しているスレッドもありますが、それを試してみても役に立ちません。
どんな助けでも大歓迎です:o)
編集 1: ConfigurationService の FB 生成スーパー クラス コンストラクターのコードは次のとおりです。
// Constructor
public function _Super_ConfigurationService()
{
// initialize service control
_serviceControl = new mx.rpc.remoting.RemoteObject();
// initialize RemoteClass alias for all entities returned by functions of this service
var operations:Object = new Object();
var operation:mx.rpc.remoting.Operation;
operation = new mx.rpc.remoting.Operation(null, "readSettings");
operation.resultType = Object;
operations["readSettings"] = operation;
operation = new mx.rpc.remoting.Operation(null, "writeSettings");
operations["writeSettings"] = operation;
operation = new mx.rpc.remoting.Operation(null, "readDBSettings");
operation.resultType = valueObjects.ConnectionParams;
operations["readDBSettings"] = operation;
operation = new mx.rpc.remoting.Operation(null, "writeDBSettings");
operations["writeDBSettings"] = operation;
operation = new mx.rpc.remoting.Operation(null, "readInitSetupCompletion");
operation.resultType = Object;
operations["readInitSetupCompletion"] = operation;
operation = new mx.rpc.remoting.Operation(null, "writeInitSetupCompletion");
operations["writeInitSetupCompletion"] = operation;
_serviceControl.operations = operations;
_serviceControl.convertResultHandler = com.adobe.serializers.utility.TypeUtility.convertResultHandler;
_serviceControl.source = "ConfigurationService";
_serviceControl.endpoint = "gateway.php";
preInitializeService();
model_internal::initialize();
}