SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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
 

Similar a 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
 

Similar a 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
 

Más de 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
 

Más de 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
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
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
 
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...
 

Services Stanford 2012