Intermittent AMFPHP problem: system.connect doesn't return a session id

ahb - September 10, 2009 - 16:03
Project:AMFPHP
Version:6.x-1.0-beta1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I am using AMFPHP/services modules to interact with Flash. I am having an intermittent problem when executing system.connect: When it's working properly it returns a response like this:

HTTP/1.1 200 OK
Date: Thu, 10 Sep 2009 15:20:29 GMT
Server: Apache
Expires: Thu, 10 Sep 2009 19:20:29 GMT
Last-Modified: Thu, 10 Sep 2009 15:20:29 GMT
Cache-Control: no-store
Pragma: no-store
Content-length: 291
Keep-Alive: timeout=15, max=83
Connection: Keep-Alive
Content-Type: application/x-amf

????AppendToGatewayUrl????I?F?SESS9e6947a6cfb27634029d183eeb11f96a=ba5061a12a72f4483935e8c7212c62fb??
/1/onResult?null?????sessid? ba5061a12a72f4483935e8c7212c62fb?user?userid??????????hostname?10.224.224.159?roles????1?anonymous user?? ?session???cache??????????? ??

When it fails it returns this:

HTTP/1.1 200 OK
Date: Thu, 10 Sep 2009 08:19:36 GMT
Server: Apache
Expires: Thu, 10 Sep 2009 01:19:36 GMT
Last-Modified: Thu, 10 Sep 2009 08:19:36 GMT
Cache-Control: no-store
Pragma: no-store
Content-length: 129
Keep-Alive: timeout=15, max=84
Connection: Keep-Alive
Content-Type: application/x-amf

????AppendToGatewayUrl????I?F?SESS3e923b281653185b85089c59e79637ef=963fc4f1ed2f0154fa423a46b661c771??
/1/onResult?null????

It doesn't seem to matter whether I am logged in or not and I am not even to the point of calling views.get or node.get.

I know that I can use an alternate method of getting the session id into the flash but this has worked perfectly except that sometimes it doesn't return the full response.

Here is the actionscript (entry point called from the flash is startLoad()):

package {
import flash.display.MovieClip;
import flash.net.NetConnection;
import flash.net.ObjectEncoding;
import flash.net.Responder;
import flash.events.Event;

import nl.demonsters.debugger.MonsterDebugger;

public class DrupalConnector extends MovieClip{
private var myService:NetConnection;
private var sessionID:String;
public var infoArray:Array;
var debugger:MonsterDebugger;
private var service_url:String;
private var service_name:String;
private var drupalEvent:Event;
/**
* Contructor
*/
public function DrupalConnector(serviceURL:String, serviceName:String){

debugger = new MonsterDebugger(this);
infoArray = new Array();
myService = new NetConnection();
service_url = serviceURL;
service_name = serviceName;

}

public function startLoad():void{

myService.objectEncoding = ObjectEncoding.AMF0;
myService.connect(service_url);
var myResponder:Responder = new Responder(getView, onFault);
myService.call('system.connect', myResponder);

}

private function getView(returnObject:*) {

var myResponder2:Responder = new Responder(getNodeInfo, onFault);
sessionID = returnObject.sessid;
myService.call('views.get', myResponder2, sessionID, service_name);
}

private function getNodeInfo(returnObject:*) {
for (var item:* in returnObject) {
infoArray.push(returnObject[item]);
}
dispatchEvent(new DrupalEvent(DrupalEvent.NODES_COMPLETE) );
}

private function onFault(f:*) {
MonsterDebugger.trace(this, "Error" + f);
for (var item:* in f) {
MonsterDebugger.trace(this, item + ": " + f[item]);
}
}
}
}

#1

ahb - September 10, 2009 - 16:35
Status:active» closed

Sorry, looks like this doesn't touch AMFPHP at all, it's in services module.

#2

ahb - September 16, 2009 - 21:33

I traced this down to the amfphp_fix_uid method.

The deserialization after replacing uid with user_id (amfphp.module line 92) returns nothing. No error, just nothing.

For now I have commented out the call since I'm not using flex, but would like to be able to stay on new release path.

#3

ahb - September 16, 2009 - 21:42
Category:support request» bug report
Status:closed» active
 
 

Drupal is a registered trademark of Dries Buytaert.