How to write a service module for Drupal 7 and Services 3.x?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by drupal7er on October 27, 2011 at 10:57pm

Can somebody please give instructions on how to write a simple service module for Services 3.x and Drupal 7.x? I simply cannot find any that works with D7. Anything! Just a reworked version of echo_service module would do!

At the very least please link to a working example. Thanks.

Comments

Theres a module called

Posted by kylebrowning on October 27, 2011 at 11:05pm

Theres a module called services_test_resource in tests folder.

So Services 3.x does no

Posted by drupal7er on October 27, 2011 at 11:19pm

So Services 3.x does no longer implement hook_services()? I'm sorry if this is stupid, but I'm really lost with this. Also, I see no services_test_resource in tests folder. :(

http://drupalcode.org/project

Posted by kylebrowning on October 27, 2011 at 11:28pm

http://drupalcode.org/project/services.git/tree/de24729354b48b3d8b987c67...

Also, don't forget to look in services.servers.api.php and services.services.api.php these are the best examples.

Thank you! Can you please

Posted by drupal7er on October 27, 2011 at 11:38pm

Thank you! Can you please explain to me the reasoning behind the CRUD model instead of arbitrary method creation? It seems I can define arbitrary methods under targeted_actions alone, what about the others?

Here's some working example

Posted by bsenftner on November 19, 2011 at 3:53pm

Here's some working example modules for creating a REST API with Services 3.0: http://www.blakesenftner.com/Services-3-examples

I created a custom module for node. where I gave my end point as 'node'.
Thus my service fires on 'https://localhost/node'.
I want to change the url as 'https://services/node' with in the custom services module. So that if I change the end point to 'xyz' the service page should be fired at 'https://localhost/services/xyz' rather than 'https://localhost/xyz'.

Services

Group organizers

Group categories

Group notifications

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

AltStyle によって変換されたページ (->オリジナル) /