Introducing, Services module

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
snelson's picture

This module was created to provide an API for Flash and Flex developers to consume Drupal core services, as well as for Drupal developers to be able to easily create services for Flash and Flex consumption. Rather than limit this type of functionality to Flash and Flex applications, namely AMF messaging, I thought it would be a better idea to create a generic solution that can be used with a number of protocals such as XMLRPC, SOAP and REST.

Over the past year, I have been using Drupal to build static websites, as it was originally intended, but have also found it to serve as an excellent backend system for Flash sites. My integration approach has evolved since day one, from XML to Drupal’s built-in XML-RPC, then AMF with AMFPHP.

AMF is the best messaging protocol for Flash and Flex, in that it is a lightweight, binary format, built right into the core of the flash player, and requires no additional 3rd party libraries (as in the case of XML-RPC). I had developed an AMFPHP module for Drupal that has worked fine for me as I am building sites in the Flash authoring environment, and with external actionscript. The problem with the old AMFPHP module is that it did not support the AMF3 format, which means it doesn’t support Flex 2. Also, it required services to be defined in classes, which did not mesh well with Drupal's modularity.

What I have created is a collection of modules that provide a common set of services for communication with Drupal. Services and server protocols are pluggable in the form of Drupal modules. I have also upgraded the AMFPHP module to serve as a server module of the services package.

What I need now is lots of feedback and testing so I can get this into a stable release. Anybody and everybody are welcome to get as involved as they would like.

To come is more comprehensive documentation, as well as screencasts to get developers on their way.

Special thanks to Mike Potter and Adobe for providing the support to make this happen.

Thanks,
Scott Nelson

Comments

wow

Veggieryan's picture

you have been busy!
all I can say is THANK YOU! This is a very important module.
I hope the documentation will include some detailed examples.
I am ready to put this to use ASAP!

thanks so much!
ryan.

gatewayUrl?

horizens@drupal.org's picture

This is going to be amazing. Great job!

The only thing I would love to know is how to determine the gatewayUrl for flash.

docs are coming

snelson's picture

I know you're all in the dark a bit, but more documetation and better help is coming shortly. I gotta work out some cvs issues first.

To answer your question, the gatewayUrl is http://example.com/services/amfphp or http://example.com/q=services/amfphp

Actually, its probably best to use /services/amfphp or /q=services/amfphp .

Thanks!

You're my hero

horizens@drupal.org's picture

Works great. Thanks so much.

Path for XMLRPC?

CrookedNumber's picture

This looks like a great module with huge potential. I'm just getting started and want to test remote capabilities first, with the XMLRPC server.

Would the URL be?

http://example.com/services/xmlrpc

If so, how would you specify the method. Something like?

http://example.com/services/xmlrpc/node/load

And then, can I add the args in the query string ? Like:

?api_key=123456789abcdefghij&nid=26

Or am I way off base? Is there no built-in HTTP/GET output for the module?

Again, thanks. This is great.

I think you're thinking of

snelson's picture

I think you're thinking of REST. XMLRPC accepts POST requests only. And those requests consist of XML containing information about the method to call etc. All requests are posted to the url http://example.com/services/xmlrpc. I suggest you look for an XMLRPC client library for whichever language you are using, and read some tutorials about XMLRPC in general.

Scott

Thanks

CrookedNumber's picture

Thanks very much! Apologies for the newbie question. I've played with XML-RPC a tiny bit (using some simple PHP abstractions), but did not realize it was POST only.

Services is awesome!

thejerz's picture

I just wanted to announce that I am helping Scott with Services by providing documentation and tutorials. This module is going to connect the flash and Drupal communities, and great things can happen from there. Here's to success!

Newer version or patch?

strayhand's picture

Hi,

I installed the services module yesterday (Tuesday) and when trying to create a new application key it spit up an error about a missing file. I went to the Drupal Web site and I found that an issue had already been created about it and it was marked "fixed." However the release notes for the module appear the same. Has there been an update to the services module? Where can I get the updated module? Thanks.

I can't freaking wait to start using these two modules (services, amfphp). Great approach.

See the fix to this problem

strayhand's picture

See the fix to this problem here: http://drupal.org/node/110625

Really interesting....

manueljperez's picture

Scott,

Thank you very much for all this work!!! Services/Amfphp is exactly what I was looking for. I am really interested in helping to make it works fine. I am starting to work with flex and have a lot of interest in the combination of both drupal and flex. Also (as I am novice with flex; not so with drupal) I will need some help.

Please contact me: manuel.perez.rubio@gmail.com

Thanks again,
Manuel J. Perez

I can't find any

jaydub's picture

I can't find any confirmation in the handbook or module files but I was just wondering if perhaps this module is 4.7.x compatible or at this point is 5.x-only? If just for 5.x, is there any plan to port to 4.7.x? This would be a very useful module for me but right now we are targeting 4.7.x

It is currently 5.0+

snelson's picture

It is currently 5.0+ only.

As of right now, I don't really have a personal need to port to 4.7, but it wouldn't take that much work at all. Maybe a couple hours tops, probably less. If you want to do it the work, I could commit it and open it up for everyone. It'd be better than having to code your own solution from scratch.

Let me know,

Scott

if you can think of it, it's already been done..

texas-bronius's picture

In all my pockets of downtime, I, too, have dreamt of using Drupal as a cms to drive flash/flex apps. Looking forward greatly to giving this a whirl when I can (and just subscribing to this thread.

Just discovered ....

Wolfflow's picture

.. incredible, as more I go deep in all what You guys develop for Drupal, as more I'm gratefull to you.
I did not yet implement the service.module on my site, first I will take a run on my local-server.
As everything will go I will notice you and help out as much as I can.

Wonderfull Module.
Thanks sincerely SNELSON

Cheers
Wolfflow