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

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

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

kylebrowning's picture

Theres a module called services_test_resource in tests folder.

So Services 3.x does no

drupal7er's picture

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

kylebrowning's picture

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

drupal7er's picture

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

bsenftner's picture

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

charubachi's picture

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: