This site is archived.

Drupal as a web services platform using the Services module

Day: 
Monday
Time: 
5:30 PM - 6:30 PM
Room: 
306 Trellon

Presented by

Greg Dunlap (heyrocker)
Palantir.net
Josh Kopel (jkopel)
squigaloo.com
Under the HoodUnder the Hood
Technical details: Study servers, Drupal core, module building, and more.

The Services module allows Drupal content (nodes, users, taxonomy and more) to be retrieved and saved through a standard API using pluggable communication mechanisms including XMLRPC, JSON and REST. Developers can also easily create their own web services to expose additional integration with contrib modules or your own custom code. In the past the main use of Services has been to provide a way for Flash apps to communicate with Drupal. However, over time, Services has been implemented in a variety of creative contexts including using Drupal as the content backend for iPhone and Android applications. This session will discuss some of the ways the Services module can help expose your Drupal content to external consumers, bring external data into Drupal, or both!

The first 45 minutes of the session will cover the Services architecture and discuss writing your own services, as well as highlighting some of the new features being included in the Drupal 7 version. The rest of the session will consist of a couple of short case studies highlighting some creative implementations using Services with Flash, mobile apps (iPhone and Android) and/or Drupal->Drupal communication.

Experience: Intermediate
Industry: education, entertainment, library, marketing, media, non-profit
Tags: android, api, flash, iphone, mobile, services

Nice if you need a hand reviewing slides if it is accepted let me know.

One of the attendees asked about JSONP and the answer to that was: "we don't know anything about it".

Well, here is a more appropriate answer. Just download the files here for a solution out of the box:

http://drupal.org/node/477012#comment-2050614

Or download the json_server module and make these small changes:

http://drupal.org/node/624898

If you need further assistance, I'll be glad to help!

Kind regards,
Nick

My apologies for neglecting to direct users to unsupported code snippets and forks of the module. I will try to be more dilligent in the future.

This is the only way to get JSONP support, unfortunately. Trust me, I would love if it could be part of the "official" release. What else can I do to make this happen?

Rolling an actual patch to the module might be a start? Module maintainers are generally overworked and when you paste code snippets into issues, or simply upload modified zip files of modules, you are saying to the maintainer that you can't be bothered working in the issue queue the way that every other drupal contributor does. If someone in the queue disagrees with your approach then you can continue to collaborate until a compromise solution is reached. If you think a module has been abandoned then you can attempt to become its new maintainer through the proper channels. I have yet to see any of these.

If you wish to continue this discussion please do so in the queues.

It's not the only way - JSONP is supported by the REST Server as far as I know (if it's not then open a ticket and Hugo will fix it): http://drupal.org/project/rest_server

A patch was provided 6 months ago:
http://drupal.org/node/598358