copyright © 2009. cybage software pvt. ltd. all rights reserved. cybage confidential. drupal web...
Post on 03-Jan-2016
216 Views
Preview:
TRANSCRIPT
Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential.
Drupal Web Services
1
Authored by: Chaitanya Anil KulkarniPresented by: Chaitanya Anil Kulkarni
Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential.
www.cybage.com
Agenda
What is Rest API Drupal web services modules Drupal default web services Browser tools Extending existing web services Custom web services Push Notifications
2
Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential.
www.cybage.com
What is Rest API
Representational state transfer (REST) o Is a way to communicate with server for performing CURD operationso It is considered as alternative to more complex mechanisms like SOAP
Basic terminologieso Resource Collection of URLs [http://example.com/resources]o RESTful API HTTP methods GET, PUT, POST and DELETE.
3
Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential.
www.cybage.com
Return Types
Web Services return format
JSON
{ "glossary": { "title": "example glossary“ } }
XML
<glossary><title>example glossary</title></glossary>.
4
Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential.
www.cybage.com
Drupal Web Services
5
Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential.
www.cybage.com
Services Modules
Serviceso Provide an API for creating web services.o It provides ability for creating methods/actions.
REST Servero Provides an REST server.o Returns output based on configured element of each service.
6
Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential.
www.cybage.com
Browser Tools
Below are tools that allows you to interact with web services and inspect the results
Firefox Add-on - PosterChrome Extension - REST Console
We need to specify specified set of parameter consumed by web services with particular action[GET, POST, PUT, DELETE].
7
Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential.
www.cybage.com
Folder Structure
Drupal follows specific set of folder structure to create custom web services.
o CustomModule1_resource
Resource file consists of operations[CURD] and actions[custom functionality]
Services file consists of predefined set of functions for performing CURD operation and access permissions for web services.
8
Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Copyright © 2009. Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential.
www.cybage.com
Push Notification
We can implement push notification by using Google cloud messaging.
GCM Connection server takes messages from 3rd party application server and send them to GCM enabled Android application.
Ports required to be opened from server must be 5228, 5229, and 5230.
Reference link
http://developer.android.com/google/gcm/http.html
9
top related