2011-07-14 6 views
0

現在、PHPバックエンドを使用してFlexアプリケーションを構築しています。 flexアプリケーションは、Zend_AMFを使用してバックエンドと対話する必要があります。Zend_Amf Channel.Connect.FailedエラーNetConnection.Call.BadVersion

コントローラとしてZend_AMFエンドポイントを実装しているので、http://localhost/myapp/amfでアクセスできます。

ZamfBrowserというサービスブラウザを使用してサービスをテストしようとしています。接続するときは

、私はこのエラーを取得:

There was an error loading the server's info. Error: (mx.rpc.events::FaultEvent)#0 
    bubbles = false 
    cancelable = true 
    currentTarget = (mx.rpc.remoting.mxml::RemoteObject)#1 
    channelSet = (mx.messaging::ChannelSet)#2 
     authenticated = false 
     channelIds = (Array)#3 
     [0] (null) 
     channels = (Array)#4 
     [0] (mx.messaging.channels::AMFChannel)#5 
      authenticated = false 
      channelSets = (Array)#6 
      connected = false 
      connectTimeout = -1 
      enableSmallMessages = true 
      endpoint = "http://localhost/myapp/amf" 
      failoverURIs = (Array)#7 
      id = (null) 
      mpiEnabled = false 
      netConnection = (flash.net::NetConnection)#8 
      client = (mx.messaging.channels::AMFChannel)#5 
      connected = false 
      maxPeerConnections = 8 
      objectEncoding = 3 
      proxyType = "none" 
      uri = "http://localhost/myapp/amf" 
      piggybackingEnabled = false 
      polling = false 
      pollingEnabled = true 
      pollingInterval = 3000 
      protocol = "http" 
      reconnecting = false 
      recordMessageSizes = false 
      recordMessageTimes = false 
      requestTimeout = -1 
      uri = "http://localhost/myapp/amf" 
      url = "http://localhost/myapp/amf" 
      useSmallMessages = false 
     clustered = false 
     connected = false 
     currentChannel = (mx.messaging.channels::AMFChannel)#5 
     heartbeatInterval = 0 
     initialDestinationId = (null) 
     messageAgents = (Array)#9 
     [0] (mx.rpc::AsyncRequest)#10 
      authenticated = false 
      autoConnect = true 
      channelSet = (mx.messaging::ChannelSet)#2 
      clientId = (null) 
      connected = false 
      defaultHeaders = (null) 
      destination = "AMF" 
      id = "D8377B12-6625-6224-9ADD-26CFA97594DC" 
      priority = -1 
      reconnectAttempts = 0 
      reconnectInterval = 0 
      requestTimeout = -1 
      subtopic = "" 
    concurrency = "multiple" 
    convertParametersHandler = (null) 
    convertResultHandler = (null) 
    destination = "AMF" 
    endpoint = "http://localhost/myapp/amf" 
    getServices = (mx.rpc.remoting.mxml::Operation)#11 
     argumentNames = (Array)#12 
     arguments = (Object)#13 
     concurrency = "multiple" 
     lastResult = (null) 
     makeObjectsBindable = true 
     name = "getServices" 
     operationManager = (null) 
     properties = (null) 
     resultElementType = (null) 
     resultType = (null) 
     service = (mx.rpc.remoting.mxml::RemoteObject)#1 
     showBusyCursor = true 
    makeObjectsBindable = true 
    managers = (null) 
    operations = (Object)#14 
     getServices = (mx.rpc.remoting.mxml::Operation)#11 
    requestTimeout = -1 
    showBusyCursor = true 
    source = "ZendAmfServiceBrowser" 
    eventPhase = 2 
    fault = (mx.rpc::Fault)#15 
    content = (Object)#16 
    errorID = 0 
    faultCode = "Client.Error.MessageSend" 
    faultDetail = "Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: 'http://localhost/myapp/amf'" 
    faultString = "Send failed" 
    message = "faultCode:Client.Error.MessageSend faultString:'Send failed' faultDetail:'Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: 'http://localhost/myapp/amf''" 
    name = "Error" 
    rootCause = (mx.messaging.events::ChannelFaultEvent)#17 
     bubbles = false 
     cancelable = false 
     channel = (mx.messaging.channels::AMFChannel)#5 
     channelId = (null) 
     connected = false 
     currentTarget = (mx.messaging.channels::AMFChannel)#5 
     eventPhase = 2 
     faultCode = "Channel.Connect.Failed" 
     faultDetail = "NetConnection.Call.BadVersion: : url: 'http://localhost/myapp/amf'" 
     faultString = "error" 
     reconnecting = false 
     rejected = false 
     rootCause = (Object)#18 
     code = "NetConnection.Call.BadVersion" 
     description = "" 
     details = "" 
     level = "error" 
     target = (mx.messaging.channels::AMFChannel)#5 
     type = "channelFault" 
    headers = (null) 
    message = (mx.messaging.messages::ErrorMessage)#19 
    body = (Object)#16 
    clientId = (null) 
    correlationId = "60935430-9E15-0B99-3D33-26CFA976D93E" 
    destination = "" 
    extendedData = (null) 
    faultCode = "Client.Error.MessageSend" 
    faultDetail = "Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: 'http://localhost/myapp/amf'" 
    faultString = "Send failed" 
    headers = (Object)#20 
    messageId = "BDB90F14-D0D5-FAFF-6A6C-26CFA9DE9C02" 
    rootCause = (mx.messaging.events::ChannelFaultEvent)#17 
    timestamp = 0 
    timeToLive = 0 
    messageId = "BDB90F14-D0D5-FAFF-6A6C-26CFA9DE9C02" 
    statusCode = 0 
    target = (mx.rpc.remoting.mxml::RemoteObject)#1 
    token = (mx.rpc::AsyncToken)#21 
    message = (mx.messaging.messages::RemotingMessage)#22 
     body = (Array)#23 
     clientId = (null) 
     destination = "" 
     headers = (Object)#24 
     messageId = "60935430-9E15-0B99-3D33-26CFA976D93E" 
     operation = "getServices" 
     source = "ZendAmfServiceBrowser" 
     timestamp = 0 
     timeToLive = 0 
    responders = (null) 
    result = (null) 
    type = "fault" 

私は解決策のためにグーグルで試してみましたが、そのエラーの原因になります任意の理由のを見つけるように見えることはできません。 display_errorsをオンにしてPHPコードをチェックしたところ、エラーはありませんでした。

ブラウザでエンドポイントにアクセスすると、アプリケーション/ amfファイルの保存を求めるプロンプトが表示されます。それを開くと、Zend Amf Endpointが表示されました。

私は他に何が原因でエラーが発生する可能性がありますか?

感謝しています。

編集:いくつかのPHPコード。私はコントローラにZend_AMFを実装するだけです。

class AmfController extends BaseController{ 

    public function __construct(){ 
     $server = new Zend_Amf_Server(); 
     $server->setProduction(false); 

     $server->setClass('ZendAmfServiceBrowser'); 
     ZendAmfServiceBrowser::setAmfServer($server); 
     echo($server->handle()); 
    } 

} 

編集:チャールズ。私は、WindowsプロキシをオンにしてCharlesを使ってみましたが、ZamfBrowserから何もキャプチャしていないようです。

ローサーからエンドポイントにアクセスすると、ファイルを保存するように求められます(amfメッセージ)。ここではチャールズ出力は次のとおりです。

GET /myapp/www/amf HTTP/1.1 
Host: localhost 
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0 
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 
Accept-Language: en-gb,en;q=0.5 
Accept-Encoding: gzip, deflate 
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 
Cookie: SESSb4604b0fcf7c7bac0da8afac2a88b017=JxMrgUUT0rl6RnLAR3emeX9gaI_Dikm3DJ4oF2TW2vQ 

(AMFとしてデコードすることができませんでした)生出力:

HTTP/1.1 200 OK 
Date: Thu, 14 Jul 2011 06:15:10 GMT 
Server: Apache/2.2.17 (Win32) mod_fcgid/2.3.6 
X-Powered-By: PHP/5.3.6 
Cache-Control: no-cache, must-revalidate 
Expires: Thu, 19 Nov 1981 08:52:00 GMT 
Pragma: no-cache 
Transfer-Encoding: chunked 
Content-Type: application/x-amf 

<p>Zend Amf Endpoint</p> 
+0

あなたがテストできるサービスブラウザがありますか? –

+0

ZamfBrowserを使用してエンドポイントをテストしています。 – F21

答えて

1

Zend_AMFユーザーの場合、NetConnection.Call.BadVersionはほとんどの場合、AMFを返信していないことを意味します。時にはAMFを出力する前に間違ったechoがあることがあります。時には、PHPコードにエラーが発生し、バックトレースが吐き出されたり、まったく何も返されないことがあります。このような場合は、Windowsの場合はPacketyzer、Mac OS Xの場合はCocoa Packet Analyzerのようなパケットスニファを使用して、何が返送されているかを確認します。また、PHP出力バッファを使用して、すべての出力を収集し、パケットスニッファを使用する代わりにファイルを検査のために保存することもできます。

+0

これは、require_onceエラーをスローするzendフレームワークの一部であったことが分かります。私はカスタムローダーを使用しており、フルクラス名を含めるパスに変換しています。一時的な修正は、すべてのzendファイルからすべての "require_once"ステートメントを削除することでした。それらのエラーが出力からどのように抑圧されたかを知るために、私はファイルへのphpロギングをオンにし、メソッドが呼び出されるたびにログをチェックしなければなりませんでした。 – F21

0

任意のコードを見てなければ、私はわからないんだけど、私は、オブジェクトについての疑問あなたのネット接続のエンコーディング?

 
    import flash.net.NetConnection; 
    import flash.net.ObjectEncoding; 

    // Set AMF version for AMFPHP 
    var netConnection:NetConnection; 
    netConnection.objectEncoding = ObjectEncoding.AMF0; // instead of AMF3 
+0

あなたの返信ありがとうございましたJason :)私は現在、アプリケーションのフレックス面を構築しているところまでいません。私はサービスブラウザ(ZAmfBrowser)を使用して、メソッドをリモートで実行しています。私は作者が提供するデモ・エンドポイントを手に入れることができましたが、自分のWebサーバーにそのエンドポイントをインストールするか、フレームワークからzend_amfをテストすることはできません。 – F21

+0

PHPコードを投稿できますか?これはおそらくMIMEタイプのレスポンスです。これはPHPコードのエラーを示したり、フックがZendクラスを正しくロードできないことがあります。チャールズのようなプロキシデバッガが追加の情報を提供するかもしれないのだろうか? –

+0

スニペットから、$ serverを定義しますが、次に$ this - > _ amfServerをsetAmfServerに渡します。たぶんプライベート変数で、$ serverはパブリックゲッター/セッターですか? –

0

私はZendAMFについて何も知りませんが、あなたがhttphttpsをmix'n'matchしようとすると、BlazeDSの中で、あなたは通常、BadVersionエラーが発生します。

関連する問題