SlideShare a Scribd company logo
1 of 14
Download to read offline
Introduction to RESTful Webservice


                    Eftakhairul Islam
                           Jr. Software Engineer
                       Right Brain Solution Ltd.
                   email: eftakhairul@gmail.com
                      web: http://eftakhairul.com
What is Webservice?




phpXpert Seminar 2011                      2
Webservice Design Models


         XML RPC 

         SOAP 

         REST 




    phpXpert Seminar 2011                 3
Inside RESTful Webservice?

        Not Techology and not even protocol

        Software archetechtural principle

        Resouces transfer over HTTP




phpXpert Seminar 2011                         4
Basic Design Principles Of REST

1.  HTTP methods explicitly
2.  Be stateless
3.  Directory structure­like URIs
4. Transfer resources by any valid MIME type 
   supported by the web service.


phpXpert Seminar 2011                           5
HTTP Methods Explicitly
                             Add Resources


POST http://api.linkedin.com/v1/people/123/friends


Content­Type: application/xml
<friend uri=“urn:linkedin:v1:people/888”/>




  phpXpert Seminar 2011                              6
HTTP Methods Explicitly
                                      Retrieve Resources
GET http://api.linkedin.com/v1/people/123

Output:
<?xml version="1.0" encoding="UTF­8"?>

<person>

     <id>123</id>

     <first­name>Sakib</first­name>

     <last­name>Stein</last­name>

     <connections total="200">

     …

</person>

         phpXpert Seminar 2011                             7
HTTP Methods Explicitly
                                    Update Resources
PUT  http://api.linkedin.com/v1/people/123


Content­Type: application/xml
<person>
    <name>Sakib Mahmud</name>
   <best­friend uri=“urn:linkedin:v1:people/999”/>
   <photo xsi:nil=“true”/>
</person>




   phpXpert Seminar 2011                               8
HTTP Methods Explicitly
                                      Delete Reasource


DELETE http://api.linkedin.com/v1/people/123/friends/456


Output:
Friend:456 will be deleted from linkedin.




   phpXpert Seminar 2011                                   9
Be Stateless
Stateful design (Non­REST):




                                           previousPage++
  Client                      Server   nextPage = previousPage
                                           return nextPage




 phpXpert Seminar 2011                                           10
Be Stateless
     Stateless design (REST):

              GET /resources/?page=2 HTTP/1.1


                    <?xml version= ”1.0” ?>
                    <rsp page=”2” nextPage=”3”>
 Client                    <resource id = ''11/>    Server
                           <resource id = ''12”/>
                        . ..
                    </rsp>




phpXpert Seminar 2011                                        11
Directory Structure­like URIs

http://example.com/topics/{topic_name}
http://graph.facebook.com/10150224661566729
http://twitter.com/statuses/user_timeline.xml?
    id=eftakhairul




 phpXpert Seminar 2011                           12
Transfer Resources By Any Valid MIME Type

Mostly Used

         XML

         JSON

         XHTML


Any other valid contend type


    phpXpert Seminar 2011                   13
Thank You


    Please Stop Software Piracy, Save Developer
                    Use FOSS or Genuine Software




phpXpert Seminar 2011                              14

More Related Content

What's hot

What's hot (20)

Global Scale ESB with Mule
Global Scale ESB with MuleGlobal Scale ESB with Mule
Global Scale ESB with Mule
 
Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
 
Java Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesJava Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web Services
 
Web service
Web serviceWeb service
Web service
 
Web Service
Web ServiceWeb Service
Web Service
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
SOAP-based Web Services
SOAP-based Web ServicesSOAP-based Web Services
SOAP-based Web Services
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
 
Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web Service
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 
SOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access Protocol
 
Impact of Restful Web Architecture on Performance and Scalability
Impact of Restful Web Architecture on Performance and ScalabilityImpact of Restful Web Architecture on Performance and Scalability
Impact of Restful Web Architecture on Performance and Scalability
 
Soap web service
Soap web serviceSoap web service
Soap web service
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
REST API Design
REST API DesignREST API Design
REST API Design
 
Wso2 integration platform deep dive eu con 2016
Wso2 integration platform deep dive   eu con 2016Wso2 integration platform deep dive   eu con 2016
Wso2 integration platform deep dive eu con 2016
 
Rest web services
Rest web servicesRest web services
Rest web services
 
WSDL in Mule Esb
WSDL in Mule EsbWSDL in Mule Esb
WSDL in Mule Esb
 

Similar to Introduction to RESTful Webservice

nguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicenguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-service
hazzaz
 
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Nguyen Duc Phu
 

Similar to Introduction to RESTful Webservice (20)

ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
Web api
Web apiWeb api
Web api
 
nguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicenguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-service
 
SPFx Webinar Loading SharePoint data in a SPFx Webpart
SPFx Webinar Loading SharePoint data in a SPFx WebpartSPFx Webinar Loading SharePoint data in a SPFx Webpart
SPFx Webinar Loading SharePoint data in a SPFx Webpart
 
RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
 
ITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul ServicesITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul Services
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using Php
 
Andrei shakirin rest_cxf
Andrei shakirin rest_cxfAndrei shakirin rest_cxf
Andrei shakirin rest_cxf
 
Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010
 
REST in Peace
REST in PeaceREST in Peace
REST in Peace
 
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
 
Rest with Spring
Rest with SpringRest with Spring
Rest with Spring
 
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
 
Restful API's with ColdFusion
Restful API's with ColdFusionRestful API's with ColdFusion
Restful API's with ColdFusion
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
 
Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST API
 
Talking to Web Services
Talking to Web ServicesTalking to Web Services
Talking to Web Services
 
11 asp.net web api
11 asp.net web api11 asp.net web api
11 asp.net web api
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Introduction to RESTful Webservice