I'm building an Estate Agent website on Drupal 7 platform. My client's agency is advertised on the most popular Irish properties website, www.daft.ie. He doesn't want to upload his property ads on both daft.ie and his own website. Once a property is uploaded to daft.ie it should automatically appear on my client's new website.

To achieve that, there is an API provided by daft.ie. It is quite well documented but I don't know where to start. I have my client's daft.ie API key which only acts as his unique ID on daft.ie.

Here is the link: http://api.daft.ie/gettingstarted.

How do I go about that? Create a custom module, a custom .tpl.php file, include functions in the website's sub-theme's template.php file?

Any help pointing me to the right direction will be much appreciated.

Comments

yelvington’s picture

Templates are for formatting output. Don't entangle anything else in them.

I'd start here: https://www.drupal.org/project/wsclient_feeds

I've not used this module (which can fetch SOAP), but I've used various parts of the Feeds suite quite a bit to pull in XML from remote sources and make nodes that can be rendered as I prefer. Create a content type with whatever fields you find useful (including image URIs). Create a feed that fetches your SOAP data and makes/updates nodes. Use Views to make search or browse displays.

You should be able to do all of this without writing any code other than perhaps a bit of CSS to control layout of your various displays.

I recommend Feeds Tamper and CSS Injector modules, as they can really speed up your work.

rydwan’s picture

Hi Steve,

Thank you for your help and sorry for my late reply. I have tried the Web Services Client for Feeds module. It does fetch the SOAP data indeed. However, after creating a feed importer and a content type with relevant fields, the data doesn't get processed. To clarify:

  1. Added Web Service Description (http://api.daft.ie/v2/wsdl.xml) and set the Type to SOAP. Operations and Data Types were instantly fetched.
  2. Created a Content Type Commercial with sample fields Title, Body, Price, Square feet.
  3. Added a Feed importer Commercial feed:
    • Basic settings: Attach to content type: Commercial.
    • Fetcher: set to Web Service Fetcher.
    • Web Service Fetcher settings: Operation set to search_commercial, from the drop down list. The API key included there.
    • Parser: set to Web Service Parser.
    • Web Service Parser settings: Result elements to parse - I think here is the problem that breaks the process. It is suggested : "... . You want to choose the array (prefixed with [*]) of elements that contain your data."

There is no such prefix in the Result elements to parse drop down list. Also, whatever option is chosen the data doesn't get processed into the content type.

Processor is set to Node processor and the Mapping is also done.

I'm obviously missing something or doing something wrong, but what?

Thanks