SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Drupal Services


Yuriy Gerasimov
email: yuri.gerasimov@gmail.com
twitter: ygerasimov
d.o.: http://drupal.org/user/257311
Presentation plan
What is Services for?
Building REST interface with Services
Resources out-of-box.
Services API
Future of Services
Architechture
Services
Move from RPC style to REST
REST
 GET safe method (only to retrieve)
 PUT and DELETE are idempotent methods (multiple
  calls should have same result)
Services 3.x
resource oriented (CRUD = create, retrieve,
update, delete, index)
Content Type
different formatters (php, json, jsonp, xml, ...)
separate endpoints (exportable to features)
authentication
Content Type
Request: URL, headers, body

Content-type: application/x-www-form-urlencoded
key1=value1&key2=value2&key3[0]=a&key3[1]=b&key3[2]=c


Content-type: application/json
{"key1":"value1","key2":"value2","key3":["a","b","c"]}
Routing




Picture from WSCCI proposal http://groups.drupal.org/node/226479
REST with Services
Create   POST     http://host/rest/node.json
Retrieve GET      http://host/rest/node/5.json
Update PUT        http://host/rest/node/5.json
Delete   DELETE http://host/rest/node/5.json
Index    GET      http://host.com/rest/node.json
REST with Services
Action
    POST http://host/rest/user/login.json
Targeted Action
    POST http://host/rest/node/5/vote.json
Relation
    GET http://host/rest/node/5/files.json
Services 3.x resources
Node resource
Taxonomy vocabulary resource (getTree)
Taxonomy term resource (selectNodes)
User resource (login, logout, register)
 Comment resource (loadNodeComments,
countAll, countNew)
System resource (no CRUD) (connect,
get_variable, set_variable)
Services 3.x resources
File resource (CRUD) (nodeFiles)
Services 3.x hook_services_resources
Services 3.x hook_services_resources
Services 3.x REST server formatters
http://<your_domain>/<your_endpoint_path>/<your_resource_path>.<formatter>




Standard: php, json, jsonp, xml, yaml, bencode (see RESTServerViewBuiltIn)
Build REST interface
Implement CRUD functionality.
 Use actions, relationships
resource/node/X/comments
Use aliases if needed.
Write tests
For public GET calls you can use Views + Views
Datasource
WSCCI
Use Symfony components
Context (HttpFoundation)
Rounting (HttpKernel)
Lazy loading
Tools & Resources
Poster https://addons.mozilla.org/en-US/firefox/addon/2691
Services Handbook http://drupal.org/handbook/modules/services
Tests
A future of Services http://goodold.se/blog/tech/future-services-3x
Groups http://groups.drupal.org/services
WSCCI http://groups.drupal.org/wscci
Questions




Yuriy Gerasimov
email: yuri.gerasimov@gmail.com
twitter/irc: ygerasimov
d.o.: http://drupal.org/user/257311

Weitere ähnliche Inhalte

Was ist angesagt?

RESTful Web Services in Drupal7
RESTful Web Services in Drupal7RESTful Web Services in Drupal7
RESTful Web Services in Drupal7
bmeme
 
WCF Data Services - Office Business Application &amp; iPhone
WCF Data Services - Office Business Application &amp; iPhoneWCF Data Services - Office Business Application &amp; iPhone
WCF Data Services - Office Business Application &amp; iPhone
Andri Yadi
 
David Keeney - SQL Database Server Requests from the Browser @ Postgres Open
David Keeney - SQL Database Server Requests from the Browser @ Postgres OpenDavid Keeney - SQL Database Server Requests from the Browser @ Postgres Open
David Keeney - SQL Database Server Requests from the Browser @ Postgres Open
PostgresOpen
 
RESTFul WebApp Concept
RESTFul WebApp ConceptRESTFul WebApp Concept
RESTFul WebApp Concept
Dian Aditya
 
Lift 2 0
Lift 2 0Lift 2 0
Lift 2 0
SO
 
Using Java to implement RESTful Web Services: JAX-RS
Using Java to implement RESTful Web Services: JAX-RSUsing Java to implement RESTful Web Services: JAX-RS
Using Java to implement RESTful Web Services: JAX-RS
Katrien Verbert
 

Was ist angesagt? (19)

RESTful Web Services in Drupal7
RESTful Web Services in Drupal7RESTful Web Services in Drupal7
RESTful Web Services in Drupal7
 
WCF Data Services - Office Business Application &amp; iPhone
WCF Data Services - Office Business Application &amp; iPhoneWCF Data Services - Office Business Application &amp; iPhone
WCF Data Services - Office Business Application &amp; iPhone
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Web services101
Web services101Web services101
Web services101
 
David Keeney - SQL Database Server Requests from the Browser @ Postgres Open
David Keeney - SQL Database Server Requests from the Browser @ Postgres OpenDavid Keeney - SQL Database Server Requests from the Browser @ Postgres Open
David Keeney - SQL Database Server Requests from the Browser @ Postgres Open
 
Xa transactions over camel routes
Xa transactions over camel routesXa transactions over camel routes
Xa transactions over camel routes
 
Azure F#unctions
Azure F#unctionsAzure F#unctions
Azure F#unctions
 
Clojure Workshop: Web development
Clojure Workshop: Web developmentClojure Workshop: Web development
Clojure Workshop: Web development
 
RESTFul WebApp Concept
RESTFul WebApp ConceptRESTFul WebApp Concept
RESTFul WebApp Concept
 
Lift 2 0
Lift 2 0Lift 2 0
Lift 2 0
 
Issues chmk (1)
Issues chmk (1)Issues chmk (1)
Issues chmk (1)
 
Using Java to implement RESTful Web Services: JAX-RS
Using Java to implement RESTful Web Services: JAX-RSUsing Java to implement RESTful Web Services: JAX-RS
Using Java to implement RESTful Web Services: JAX-RS
 
Modulo para conectar un programa en vb 6
Modulo para conectar un programa en vb 6Modulo para conectar un programa en vb 6
Modulo para conectar un programa en vb 6
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
 
Jersey
JerseyJersey
Jersey
 
Rest hello world_tutorial
Rest hello world_tutorialRest hello world_tutorial
Rest hello world_tutorial
 
REST and Web API
REST and Web APIREST and Web API
REST and Web API
 
GAB 2019 - Integrate Microsoft Graph​ with Azure Active Directory​ in your cl...
GAB 2019 - Integrate Microsoft Graph​ with Azure Active Directory​ in your cl...GAB 2019 - Integrate Microsoft Graph​ with Azure Active Directory​ in your cl...
GAB 2019 - Integrate Microsoft Graph​ with Azure Active Directory​ in your cl...
 
Multipart form data
Multipart form dataMultipart form data
Multipart form data
 

Andere mochten auch

Pepe simeu rimini 2008 atrial fibrillation
Pepe simeu rimini 2008 atrial fibrillationPepe simeu rimini 2008 atrial fibrillation
Pepe simeu rimini 2008 atrial fibrillation
Emergenza Urgenza
 
DrupalCafe Kyiv EntityAPI
DrupalCafe Kyiv EntityAPIDrupalCafe Kyiv EntityAPI
DrupalCafe Kyiv EntityAPI
Yuriy Gerasimov
 
Pha thai
Pha thaiPha thai
Pha thai
Huong
 

Andere mochten auch (20)

Apache SOLR | Drupal Camp Kyiv 2010
Apache SOLR | Drupal Camp Kyiv 2010Apache SOLR | Drupal Camp Kyiv 2010
Apache SOLR | Drupal Camp Kyiv 2010
 
DrupalCafe Kyiv CTools
DrupalCafe Kyiv CToolsDrupalCafe Kyiv CTools
DrupalCafe Kyiv CTools
 
Inline elements. DrupalCamp Berlin 2014
Inline elements. DrupalCamp Berlin 2014Inline elements. DrupalCamp Berlin 2014
Inline elements. DrupalCamp Berlin 2014
 
Catalogo camp 8
Catalogo camp 8Catalogo camp 8
Catalogo camp 8
 
Delayed operations with Queues
Delayed operations with QueuesDelayed operations with Queues
Delayed operations with Queues
 
Catalogo camp 6
Catalogo camp 6Catalogo camp 6
Catalogo camp 6
 
Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011
 
Commercial
CommercialCommercial
Commercial
 
Workshop > generatie zap of generatie gezond?
Workshop > generatie zap of generatie gezond?Workshop > generatie zap of generatie gezond?
Workshop > generatie zap of generatie gezond?
 
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Automated UI testing. Selenium. DrupalCamp Kyiv 2011Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
 
BADCamp 2012 Facet API
BADCamp 2012 Facet APIBADCamp 2012 Facet API
BADCamp 2012 Facet API
 
Pepe simeu rimini 2008 atrial fibrillation
Pepe simeu rimini 2008 atrial fibrillationPepe simeu rimini 2008 atrial fibrillation
Pepe simeu rimini 2008 atrial fibrillation
 
DrupalCafe Kyiv EntityAPI
DrupalCafe Kyiv EntityAPIDrupalCafe Kyiv EntityAPI
DrupalCafe Kyiv EntityAPI
 
DrupalCafe Kyiv drupal8
DrupalCafe Kyiv drupal8DrupalCafe Kyiv drupal8
DrupalCafe Kyiv drupal8
 
DrupalCafe7 CTools AJAX responder
DrupalCafe7 CTools AJAX responderDrupalCafe7 CTools AJAX responder
DrupalCafe7 CTools AJAX responder
 
Gastcollege > Jongeren & social media > Universiteit Twente
Gastcollege > Jongeren & social media > Universiteit TwenteGastcollege > Jongeren & social media > Universiteit Twente
Gastcollege > Jongeren & social media > Universiteit Twente
 
DrupalCafe5 VCS
DrupalCafe5 VCSDrupalCafe5 VCS
DrupalCafe5 VCS
 
Pha thai
Pha thaiPha thai
Pha thai
 
Code Driven Development Zaporozhye DrupalForum
Code Driven Development Zaporozhye DrupalForumCode Driven Development Zaporozhye DrupalForum
Code Driven Development Zaporozhye DrupalForum
 
Cmm Myself
Cmm MyselfCmm Myself
Cmm Myself
 

Ähnlich wie Services Stanford 2012

Services in Drupal 8
Services in Drupal 8Services in Drupal 8
Services in Drupal 8
Andrei Jechiu
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
Carol McDonald
 
JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011
Shreedhar Ganapathy
 
Building social and RESTful frameworks
Building social and RESTful frameworksBuilding social and RESTful frameworks
Building social and RESTful frameworks
brendonschwartz
 

Ähnlich wie Services Stanford 2012 (20)

Services in Drupal 8
Services in Drupal 8Services in Drupal 8
Services in Drupal 8
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVC
 
Network Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyNetwork Device Database Management with REST using Jersey
Network Device Database Management with REST using Jersey
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
RESTing with JAX-RS
RESTing with JAX-RSRESTing with JAX-RS
RESTing with JAX-RS
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web services
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
 
Rest
RestRest
Rest
 
Creating Restful Web Services with restish
Creating Restful Web Services with restishCreating Restful Web Services with restish
Creating Restful Web Services with restish
 
Native REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gNative REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11g
 
CDI, Seam & RESTEasy: You haven't seen REST yet!
CDI, Seam & RESTEasy: You haven't seen REST yet!CDI, Seam & RESTEasy: You haven't seen REST yet!
CDI, Seam & RESTEasy: You haven't seen REST yet!
 
Rest and Rails
Rest and RailsRest and Rails
Rest and Rails
 
Andrei shakirin rest_cxf
Andrei shakirin rest_cxfAndrei shakirin rest_cxf
Andrei shakirin rest_cxf
 
Android and REST
Android and RESTAndroid and REST
Android and REST
 
JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
DrupalCafe4 Kiev Services
DrupalCafe4 Kiev ServicesDrupalCafe4 Kiev Services
DrupalCafe4 Kiev Services
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
Modularizing RESTful Web Service Management with Aspect Oriented Programming
Modularizing RESTful Web Service Management with Aspect Oriented ProgrammingModularizing RESTful Web Service Management with Aspect Oriented Programming
Modularizing RESTful Web Service Management with Aspect Oriented Programming
 
Building social and RESTful frameworks
Building social and RESTful frameworksBuilding social and RESTful frameworks
Building social and RESTful frameworks
 

Mehr von Yuriy Gerasimov

CI and other tools for feature branch development
CI and other tools for feature branch developmentCI and other tools for feature branch development
CI and other tools for feature branch development
Yuriy Gerasimov
 

Mehr von Yuriy Gerasimov (10)

Progressing to Team Lead
Progressing to Team LeadProgressing to Team Lead
Progressing to Team Lead
 
What kind testing DUG Vancouver
What kind testing DUG VancouverWhat kind testing DUG Vancouver
What kind testing DUG Vancouver
 
Editor Experience in Drupal 8
Editor Experience in Drupal 8Editor Experience in Drupal 8
Editor Experience in Drupal 8
 
Load Testing with JMeter
Load Testing with JMeterLoad Testing with JMeter
Load Testing with JMeter
 
Ci. Drupal Camp Berlin 2014
Ci. Drupal Camp Berlin 2014Ci. Drupal Camp Berlin 2014
Ci. Drupal Camp Berlin 2014
 
CI and other tools for feature branch development
CI and other tools for feature branch developmentCI and other tools for feature branch development
CI and other tools for feature branch development
 
Drupal 8 Routing
Drupal 8 RoutingDrupal 8 Routing
Drupal 8 Routing
 
Clean code and refactoring
Clean code and refactoringClean code and refactoring
Clean code and refactoring
 
Drupal camp donetsk c tools
Drupal camp donetsk c toolsDrupal camp donetsk c tools
Drupal camp donetsk c tools
 
Automated UI testing with Selenium
Automated UI testing with SeleniumAutomated UI testing with Selenium
Automated UI testing with Selenium
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 

Services Stanford 2012