AMFPHP Server Updated!

Events happening in the community are now at Drupal community events on www.drupal.org.
snelson's picture

The AMFPHP Server module has been updated to now require AMFPHP 1.9 beta 2. Let me know if any of you find any problems.

http://drupal.org/project/amfphp

Scott

Comments

Great!

Chris Charlton's picture

This was a common issue with installations, everyone first grabbed the latest, greatest AMFPHP beta2 when trying the Services module out. Now, there will be a lot less "broken" installs.

Also, I can't find extensive release notes. Should I just watch the resolved issues list?

Chris Charlton, Author & Drupal Community Leader, Enterprise Level Consultant

I teach you how to build Drupal Themes http://tinyurl.com/theme-drupal and provide add-on software at http://xtnd.us

CVS Messages works for me

Chris Charlton's picture

The Services module's CVS messages work for me. :)

http://drupal.org/project/cvs/80193

Chris Charlton, Author & Drupal Community Leader, Enterprise Level Consultant

I teach you how to build Drupal Themes http://tinyurl.com/theme-drupal and provide add-on software at http://xtnd.us

Works great for me! Thanks

newms's picture

Works great for me! Thanks for all the heard work on these modules.

amfphp

sinewaver's picture

Hi Scott,
I must be doing something wrong - but can't figure out what. I keep receiving a path error e.g.:
Error opening URL "http://localhost:8888/?q=sites/all/modules/amfphp"
I've got remoting components placed in the library, and have tried various adjustments to the path e.g. removing php query. etc.
The actionscript is copied from the Services advice, I've checked flash security settings...
Can anyone provide any pointers? Thanks in anticipation, I so want to start using services,

Sinewaver

It seems you don't have

Chris Charlton's picture

It seems you don't have Clean URLs turned on in your Drupal config. Do that first.

Chris Charlton, Author & Drupal Community Leader, Enterprise Level Consultant

I teach you how to build Drupal Themes http://tinyurl.com/theme-drupal and provide add-on software at http://xtnd.us

Clean URLs

sinewaver's picture

Thanks for the reply, ccharlton.
I finally turned on Clean Url's - no easy matter in Tiger OS X - but still no joy with amfphp. I'm on localhost, and have tried paths ending /modules/amfphp and /services/amfphp... I've included a security.allowDomain in my Actionscript file too - but that didn't help.

When I run test the file:
// Picking up a Drupal node with flash remoting
// Drupal must be set up with Services module enabled
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
import mx.remoting.debug.NetDebug;

System.security.allowDomain("http://localhost:8888")

// expose debugging info to clientside "NetConnection debugger" utility
mx.remoting.debug.NetDebug.initialize();

// create, position, and set params on three dynamic text fields: status, node-title, and node-body
var tf:TextField = this.createTextField("status", 10, 0, 0, 200, 200);
var ntitle:TextField = this.createTextField("nodetitle", 11, 0, 50, 200, 200);
var nbody:TextField = this.createTextField("nodebody", 12, 0, 100, 200, 400);
ntitle.html = true;
ntitle.multiline = true;
nbody.html = true;
nbody.multiline = true;
nbody.wordWrap = true;

// establish connection with remote service gateway in Drupal and specify service
// - /services/amfphp is AMFPHP in Services gateway
// - node is one of the two default, exposed services in Services module. The other is view.
var node:Service = new Service("http://localhost:8888/sites/all/modules/services/amfphp", new Log(), "node", null, null);
// call service method
// - load is one of three methods on the default node service
// - pass in which node to load (hard coded "1" here for node 1)
// - optional additonal param to node.load is what fields to return (like in a view?).
// -- array of field names: node.load(1, ['title', 'body']);
// -- default is to send the entire node. This example does that.
var pc:PendingCall = node.load(1);
// set up response handler functions
pc.responder = new RelayResponder(this, "getData_Result", "getData_Fault");

// set default status text
tf.text = "no response from server yet.";

// success result handler
function getData_Result( re:ResultEvent ):Void {
// re is the object containing the response
// two properties you can count on being populated for any node are re.result.title and re.result.body
tf.text = "response:";
ntitle.htmlText = "Node Title:
" + re.result.title;
nbody.htmlText = "Node Body:
" + re.result.body;
}

// failure result handler
function getData_Fault( fe:FaultEvent ):Void {
tf.text = "error";
}

  • which is essentially copied from drupal, I get the message 'no response from server yet.' When I test amfphp in Drupal I get the screen saying everything is working... but I can't connect from Flash. I always get a path error. Where am I going wrong?

with clean urls enabled, the

g10's picture

with clean urls enabled, the path should be in the form of + "services/amfphp"… so http://localhost:8888/services/amfphp should do the trick for you

Amfphp issue continues

sinewaver's picture

Thanks for the reply. I have used that path - which tells me, in Drupal, that amfphp is working correctly - but I still get a path error from the Flash 8 end.
Error opening URL "http://localhost:8888/services/amfphp"

Does the [Drupal] Service browser work?

Chris Charlton's picture

Are you able to hit your services correctly with the Drupal Service Browser provided by the module?

Chris Charlton, Author & Drupal Community Leader, Enterprise Level Consultant

I teach you how to build Drupal Themes http://tinyurl.com/theme-drupal and provide add-on software at http://xtnd.us

Service Browser

sinewaver's picture

Err... no... Thanks for the pointer, ccharlton.
(Since I last posted I have managed to lose the path error - now I simply get "no response from server yet".)
The Drupal service browser says 'page not found'. So I have tried altering the path in the service-config.xml file, which was still pointing to gateway.php, to services/amfphp. It hasn't changed anything. I don't know if it matters, since perhaps it was overridden anyway. I also changed the path of amfphp/amfphp/browser... I don't get any errors in activity - but the browser doesn't find anything. I'm sure you have highlighted where the problem is - I just don't know how to fix it.

Service Browser

sinewaver's picture

Do I need to explicitly put a browser into the services module? Or the Drupal amfphp module? I can't see one there...

Services module has its own

Chris Charlton's picture

The Services module for Drupal has its own service browser. It's HTML-based but I definitely would recommend getting all the settings right for your Drupal before debugging any Flash. Making sure the two minimum modules are installed and up-to-date, AMFPHP module and Services module. I'm sure you got those because you're trying a bunch of paths. All the little configuration stuff covered in the docs and screencasts are really important.

The Clean URLs option helps clean up and reduce your gateway paths, and Drupal paths for that matter - this is important for the Services and AMFPHP modules. As the screencasts show, when permissions (in Drupal) are set for the Services browser, you should be able to see a list of Servers (AMFPHP and XMLRPC) and Services (node, system, taxonomy, user, ...). If you see that, and clean URLs are on, test the AMFPHP server link. If that gateway registers fine then click the node.load service. You should be taken to a form with nid and fields as the input fields on the form. This is the "Drupal Services Browser." Test node.load and make sure you get back an entry (nid = nodeID). If a formatted result comes back then move onto your [project] services XML then your Flash/Flex.

Hope that helps.

Chris Charlton, Author & Drupal Community Leader, Enterprise Level Consultant

I teach you how to build Drupal Themes http://tinyurl.com/theme-drupal and provide add-on software at http://xtnd.us

Browser

sinewaver's picture

Ah-hah, I misunderstood you before.
Yes, that all works. I have enabled clean url's, Amfphp link says everything is fine go ahead... Modules all enabled. node.load service retrieves nodes and fields... services-config.xml is pasted from 5etdemi, with uri reset to /services/amfphp...
The services-config.xml file is in amfphph/amfphp browser. Is that the wrong place for it?

a couple things I don't do

Chris Charlton's picture

I'm glad you've got that rolling. Okay, let me comment on a couple things.

  1. I don't use the AMFPHP Service browser - delete that folder on any public domain/site.
  2. I don't upload my services-config.xml once my SWF is compiled. I haven't needed to.
  3. Comb over and over the services-config.xml and make sure you've gotten everything changed for your project (unless you're doing the standard examples).
  4. Even if you read it all, read it again!!!

Ugh. I know it's frustrating but you'll wanna try every stupid, mundane, already-tried-it idea. I do a crap load of local development so my comments above may not work for every environment but I'm not doing anything special to get things started.

Chris Charlton, Author & Drupal Community Leader, Enterprise Level Consultant

I teach you how to build Drupal Themes http://tinyurl.com/theme-drupal and provide add-on software at http://xtnd.us

Browser

sinewaver's picture

... services/amfphp/amfphp/browser, I mean...

Problem with AMFPHP

gabiroba's picture

Hi Everybody:

I followed up all the steps written here. But I think I'm missing something since I don't get Flash to get records from drupal. It seems Drupal is not sending the that.
I placed the services-config.xml in browser with the correct uri. Is there something else I should do to get it working.

Thanks
Gabriela

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: