How a module can offer its own webservice ?

View: New views
4 Messages — Rating Filter:   Alert me  

How a module can offer its own webservice ?

by ecor6633 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I built my first module which stores data in its own tables using
db_query(...).

Now, i'd like to manage thoses tables through a webservice which would
be a part of my module but i'm wondering how to achieve it.

As it is my first module i'm not really familiar with the API so how
could i integrate a uri in drupal site which would lead to a php5 web
service and how could i get access to db_query() in that script ?

I thought about :
http://localhost/drupal/sites/default/modules/myfirstmodule/service.php

Or maybe is there a special hook in modules that does not lead to a
drupal page with theming etc. Until now i only could create blocks.

If anybody has hints, i would appreciate.

Thanks,

Eric
--
[ Drupal support list | http://lists.drupal.org/ ]

Re: How a module can offer its own webservice ?

by FredJones :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Now, i'd like to manage thoses tables through a webservice which would be a
> part of my module but i'm wondering how to achieve it.

First Google result for "drupal web service" is:

http://drupal.org/project/Services

'nuf said
--
[ Drupal support list | http://lists.drupal.org/ ]

Re: How a module can offer its own webservice ?

by Metzler, David :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you register a function in hook menu and the page does php print
instead of returning $output, you will bypass the theming layer.  I do
this regularly to return XML data instead of a drupal themed page.  

Does that answer your question?

-----Original Message-----
From: support-bounces@... [mailto:support-bounces@...] On
Behalf Of Eric Cornely
Sent: Wednesday, July 01, 2009 2:45 AM
To: support@...
Subject: [support] How a module can offer its own webservice ?

Hello,

I built my first module which stores data in its own tables using
db_query(...).

Now, i'd like to manage thoses tables through a webservice which would
be a part of my module but i'm wondering how to achieve it.

As it is my first module i'm not really familiar with the API so how
could i integrate a uri in drupal site which would lead to a php5 web
service and how could i get access to db_query() in that script ?

I thought about :
http://localhost/drupal/sites/default/modules/myfirstmodule/service.php

Or maybe is there a special hook in modules that does not lead to a
drupal page with theming etc. Until now i only could create blocks.

If anybody has hints, i would appreciate.

Thanks,

Eric
--
[ Drupal support list | http://lists.drupal.org/ ]
--
[ Drupal support list | http://lists.drupal.org/ ]

Re: How a module can offer its own webservice ?

by ecor6633 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think so, i'll give this a try.

Thanks a lot

Metzler, David a écrit :

> If you register a function in hook menu and the page does php print
> instead of returning $output, you will bypass the theming layer.  I do
> this regularly to return XML data instead of a drupal themed page.  
>
> Does that answer your question?
>
> -----Original Message-----
> From: support-bounces@... [mailto:support-bounces@...] On
> Behalf Of Eric Cornely
> Sent: Wednesday, July 01, 2009 2:45 AM
> To: support@...
> Subject: [support] How a module can offer its own webservice ?
>
> Hello,
>
> I built my first module which stores data in its own tables using
> db_query(...).
>
> Now, i'd like to manage thoses tables through a webservice which would
> be a part of my module but i'm wondering how to achieve it.
>
> As it is my first module i'm not really familiar with the API so how
> could i integrate a uri in drupal site which would lead to a php5 web
> service and how could i get access to db_query() in that script ?
>
> I thought about :
> http://localhost/drupal/sites/default/modules/myfirstmodule/service.php
>
> Or maybe is there a special hook in modules that does not lead to a
> drupal page with theming etc. Until now i only could create blocks.
>
> If anybody has hints, i would appreciate.
>
> Thanks,
>
> Eric
> --
> [ Drupal support list | http://lists.drupal.org/ ]
> --
> [ Drupal support list | http://lists.drupal.org/ ]
--
[ Drupal support list | http://lists.drupal.org/ ]