Hello I am using the following configuration :

amfphp 6.x-1.0-beta1
services 6.x-0.13

I have configured services module,permissions and api key but I got this error message as I try to connect by flash AS3 script :

DrupalSite: error while attempting to invoke Drupal service
description: Method system.connect does not exist.
code: AMFPHP_RUNTIME_ERROR
details: C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\FlashDrupal\sites\all\modules\amfphp\amfphp.module
level: Unknown error type
line: 106

Any help appreciated thanx in advance Marco Gonnelli

CommentFileSizeAuthor
#14 servicePermissionsDev-1.jpg31.2 KBsanbeaman

Comments

snelson’s picture

Assigned: Unassigned » snelson
Category: bug » support
Priority: Critical » Normal

Enable system_service.module

DrplMG’s picture

Sry forgot toI enable system_service.module.
thanx.
Marco

robbertnl’s picture

I also got an AMFPHP runtime error:
fault: [RPC Fault faultString="Access denied." faultCode="AMFPHP_RUNTIME_ERROR" faultDetail="D:\Apache2.2\htdocs\drupal\sites\all\modules\amfphp\amfphp.module on line 106"]

The settings/modules i am using:
-method: node.get
-enabled services for nodes.
-disabled Use keys and Use sessid
-Services 6.x-1.x-dev
-AMFPHP 6.x-1.0-beta1 with AMFPHP 1.9 beta 2

bluestarstudios’s picture

I'm getting the same original error ("Method <em>something.something</em> does not exist").
I have the system service enabled. What else am I doing wrong?

robbertnl’s picture

I got it all working by following this tutorial: http://electricpineapple.net/?p=32

bluestarstudios’s picture

Does anybody know of any tutorials how to make AMFPHP work with Flash CS3/CS4 (AS3)?

Mershin’s picture

I was getting this error in Flash CS3(AS3).

I followed http://thanksfornotsuing.com/discussion/flash-integration-drupal-6

And then I was still getting AMFPHP_RUNTIME_ERROR line 106 (yes I had everything configured correctly).

I had Keys turned off, sessionIds turned on. I was able to 'trace' a SessionID that was returned, but when I called node.get, I got the runtime error.

Personally my problem in the end? I was trying to connect to www.domainname.com/services/amfphp while running the compiled swf from the flash IDE.

I turned on the debugger and saw that flash really does not like some sort of new security restriction involving master policy file. It's something like crossdomain.xml but not exactly? I did have a crossdomain.xml that allowed 'everything', but flash was ignoring it (The debug message actually said it was ignoring it). Anything flash player 9.0.124+ has this security requirement.

Once I uploaded my swf file to domainname.com, it pulled the node info correctly.

I imagine if you're running drupal on localhost, it should work?

A few things I had to double check:
- services/amfphp module enabled
- the services modules for node & service enabled (another set of modules included.)
- enabled sessionid but disabled keys in the services config.

I guess that's it.. latest versions of everything as of today, on drupal 6.

libeco’s picture

I bought the book Flash in Drupal by Travis Tidwell and was following along chapter two which also shows a very basic way of loading Drupal data into Flash. I'm used to OO as I learned that at school, so I was using proper classes and was presented the same error. So I tried the example code from the book and again got the error. I have tried contacting Travis Tidwell through his site, with a link to this topic. I hope he has a solution, otherwise it seems like money thrown away for a book which shows code that doesn't work.

I was trying locally. I have tried loading the swf through localhost, but nothing was loaded.

I hope there's a solution to this problem...

Mershin’s picture

I do have a working drupal/flash implementation...

This is the basics... (Using Flash CS4 IDE)

var drupal:NetConnection = new NetConnection();
drupal.objectEncoding=flash.net.ObjectEncoding.AMF3;
var sessionId:String;

drupal.connect( "http://www.sitename.com/services/amfphp");
drupal.call( "system.connect", new Responder(onConnect, onError ) );

function onConnect( result:Object ) {
	sessionId=result.sessid;
	trace(sessionId);
}

function onError( error:Object ) {
	for each (var item in error) {
		textfield.appendText(item);
	}
}

If you get a sessionid outputted... then you're in business. If you can't get that far, then it's a configuration issue. Take a closer look at permissions section after you enable services & amfphp. I broke my brain getting it to work but hey when you have a deadline and you're on the 8th can of diet pepsi... something ends up working :p

If you got this far... I can get into node or views data.

I'm pulling 5 different content types of data into a flash interface with cck fields, including pictures being pulled/displayed, and the flash interface links to the drupal content. I have working code examples if you're this far.

libeco’s picture

Thanks for helping. I do get the sessionID, also with the code from the book. But getting the node seems to be the problem for me.

This was my code as I got it from the book:

package {
	import flash.display.MovieClip;
	import flash.net.NetConnection;
	import flash.net.Responder;
	import flash.net.ObjectEncoding;
	
		public class Main extends MovieClip {
			var baseURL:String = "http://localhost/2009-06-12_drupaltest";
			var gateway:String = baseURL + "/services/amfphp";
			var drupal:NetConnection = new NetConnection();
			var nodeId:Number = root.loaderInfo.parameters.node;
			var responder:Responder = new Responder(onConnect, onError);
			var sessionId:String = "";
			
			public function Main() {
				drupal.objectEncoding = ObjectEncoding.AMF3;
				drupal.connect(gateway);
				drupal.call("system.connect", responder);
			}
			
			function loadNode(nid:Number) {
				var nodeResponse:Responder = new Responder(onNodeLoad, onError);
				drupal.call("node.get", nodeResponse, sessionId, nid);
			}
			
			function onNodeLoad(node:Object) {
				trace(node.title);
				title.text = node.title;
			}
			
			function onConnect(result:Object) {
				sessionId = result.sessid;
				trace("connected");
				trace("Session Id: " + sessionId);
				loadNode(nodeId);
			}
			
			function onError(error:Object) {
				for each(var item in error) {
					trace(item);
				}
			}
			
	} // End of class
} // End of package

*edit*
Actually, I just realised the opening poster is using Services 6.x-0.14, while I'm using Services 6.x-2.x-dev, don't know if that makes a difference?

Mershin’s picture

hmm.. I have 6.x-0.13 installed. I think that may be your problem... dev version must be doing something different. Try 6.x-0.14?

This works on my install... it traced the title of the node.

var drupal:NetConnection = new NetConnection();
drupal.objectEncoding=flash.net.ObjectEncoding.AMF3;
var sessionId:String;

drupal.connect( "http://www.sitename.com/services/amfphp");
drupal.call( "system.connect", new Responder(onConnect, onError ) );

function onConnect( result:Object ) {
sessionId=result.sessid;
trace(sessionId);
loadNode();
}

function loadNode() {
var nodeResponse:Responder = new Responder(onNodeLoad, onError);
drupal.call("node.get", nodeResponse, sessionId, 24);
}

function onNodeLoad(node:Object) {
trace(node.title);
}

function onError( error:Object ) {
for each (var item in error) {
trace(item);
}
}
libeco’s picture

I had some e-mail contact with the author of the book and he also said that I should use 0.14. I just tried with your code and it indeed works now, even on localhost.

Thanks!

Mershin’s picture

No problem. Enjoy Flash & Drupal Integration. I'm having fun using views with arguments based on user input to pull subsets of data to display :)

sanbeaman’s picture

StatusFileSize
new31.2 KB

I'm hoping you solved this, and if so could offer some help.

I was following the tidwell Hello World exercise.

Initially, I had installed Services 6.x -0.14 , but after a couple hours of deactivating, reactivating, reinstalling, etc..
I found an issue posted by Tidwell himself. (still unresolved as of July 6th, 2009)
http://drupal.org/node/504526

Where the Keys won't show up....
So I had to install the Dev version 6.x-2.x-dev

At which point I was having the same issue as libeco

SessionID comes back no problem.
But trying to access node title I would get the error:
.....
Missing Required Arguments
106
AMFPHP_RUNTIME_ERROR
......

Since 0.14 permissions are set up different than 6.x-2.x-dev
I guessed at opening up what seemed like similar permissions as "access services"
System_service module
-check module exists from remote: (all three checked)
-get variable from remote: (all three checked)
-set variable from remote (all three checked)
see attached image.

this still didn't help.
It was only after I unchecked Use Keys, in the Services Settings.

Maybe it's me, and believe me it's me 99% of the time,
but I don't see passing the KEY in any of the code examples in book or in this thread?

has any one successfully retrieved the node.title, using version 6.x-2.x-dev and using both security methods, SessionId and KEY?

drewbe

that

sanbeaman’s picture

The errata for the book pretty much answers my above question:
http://www.packtpub.com/view_errata/book/build-flash-applications-with-d...

Dev-services pack handles KEYs in different way, so using it you have to turn off KEYS.

icarus (drewbe_

Mershin’s picture

hmm... only way I got it to work myself was with sessionIDs "on" but KEYS "off'. This is of course a security concern, but since my flash application only needed to "read" from Drupal, and not do anything that "could" be a security concern, that was ok for me.

Good to know the info from the above link since I was using 6.13 and 6.14 came out shortly after I started my project. Good thing I didn't update mid-project :)

pisosse’s picture

hmmm... I got this version of the amfphp problem

"You have an error in your SQL syntax" and this is after a reinstallation of drupal og rebuild of the DB.. I'm getting crazy

edit:

now..the problem is that services node.get dont get nodeid..what to do?

darkodev’s picture

I can confirm that I can now pull node data after going to admin/build/services/settings, selecting "Key authentication" from the drop-down, and unchecking "Use keys." It wasn't intuitive that I had to choose an authentication method, then disable it with a checkbox.

Works from the IDE, and from localhost.

Using Services 6.x-2.0-beta1

Thanks to everyone on this thread!

miglsilva’s picture

Alert:
I had similar problems with AMFPHP in Flash and I found an incompatibility with the DEVEL module (services_admin_browse.inc - line 188).
I desabled this module and now my "Hello Worls" works very well.

nexus74’s picture

Thank you darko! That worked for me as well. Yes, having to enable "Key authentication", then disabling it in service settings is VERY counter-intuitive...

jdeg’s picture

Somebody found the way to use "Use keys". What could be the possible security issues without using it?

Thanks in advance!