views:

364

answers:

2

I'm a .net developer who needs to write a drupal module in php to access a .net web service.

The php will have to do some local storage, I assume in the drupal data store.

Can anyone recommend some good pointers on how to go about getting into drupal development?
or suggest some good links on how to tackle the problem above?

Thanks muchly.

Edit:
The drupal datastore will be used to store a key which is associated with a 3rd party website.
This key is unqiue per drupal user.
This key will be retrieved from the webservice for each drupal user.
The key will be passed to some javascript, which will then do something else.

+1  A: 

We'll likely need more details on what you want Drupal to do with the data. Will it be tied to nodes, how frequently should it be fetched, etc.

As for actually accessing the web service, the drupal_http_request() and Drupal's XML-RPC functions should be of use.

ceejayoz
Thanks for the response, see my edit.
Bravax
+1  A: 

Rough sketch of how I'd go about it:

  • Create blank, custom module
  • Implement hook_install() to create your own table (check hook_schema() for this also) to store your mapping of user id ('uid' in Drupal) to key
  • Implement hook_user() to add your key to the user object on the 'load' operation.
    • Fetch the key from local storage, if already there, otherwise fetch from web service
    • NOTE: You did not specify when and how often you want to fetch/update the key from the service - check out the other operations of hook_user() (e.g. 'login', 'insert' etc.), as well as other hooks like e.g. hook_cron() to get some options.
  • Add js to use the key for 'something else' - check links below for js/jquery handling in Drupal
  • Be nice - implement hook_uninstall() to remove your tables, if module gets uninstalled ;)

Some starting points concerning documentation:


I'm a .net developer who needs to write a drupal module in php

Prepare for some pain - I came to Drupal from a c#/.net background also, and while I can appreciate many aspects of Drupal (and even some of php ;) in the meantime, I still find myself cursing a lot concerning the 'perils' of dynamic typing, a certain lack of OOD practices and phps 'incompleteness' in general ;)

HTH & Good luck

Henrik Opel