SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
Creating and Consuming
Web Services in PHP 5
      Central Florida PHP




                            1
Creating and Consuming
Web Services in PHP 5

• Web Service Basics
• Using Existing Web Services
• Rolling Your Own Web Service




                                 2
Web Service Basics




                     3
What are Web Services?


• According to WikiPedia
 • “Web Services are frequently just Web APIs that
   can be accessed over a network, such as the
   Internet, and executed on a remote system
   hosting the requested services”




                                                     4
What are Web Services?


• ...in fewer words
  • “Web Services are a way to send and receive
    information between remote programs.”




                                                  5
What are Web Services
Good For?




                        6
What are Web Services
Good For?


          Resource




                        6
What are Web Services
Good For?
           Consumer




          Resource




                        6
What are Web Services
Good For?
                   Consumer




                  Resource    Consumer
       Consumer




                   Consumer




                                         6
What are Web Services
Good For?
                   Consumer




                  Resource    Consumer
       Consumer




                   Consumer




                                         6
What are Web Services
Good For?
                   Consumer




                  Resource    Consumer
       Consumer




                   Consumer




                                         6
What are Web Services
Good For?
                   Consumer




                  Resource    Consumer
       Consumer




                   Consumer




                                         6
What are Web Services
Good For?
                   Consumer




                  Resource    Consumer
       Consumer




                   Consumer




                                         6
What are Web Services
Good For?
                   Consumer




                  Resource    Consumer
       Consumer




                   Consumer




                                         6
Types of Web Services

• XML-RPC
• SOAP
• REST
• Free-form




                        7
XML-RPC

• RPC = Remote Procedure Call
• The “Grandfather” of XML-based RPC
  services
 • Hence it’s name
 • Since 1998
 • A precursor to SOAP



                                       8
XML-RPC Libraries

• http://php.net/xmlrpc/
  • Native PHP support since 4.1.0
  • Not enabled by default
  • Documentation Sucks
• http://phpxmlrpc.sourceforge.net/
  • Useful, Inc (Who also brought you XML-RPC)



                                                 9
XML-RPC Libraries

• http://pear.php.net/package/XML_RPC/
 • The classic, tried and true library
 • PHP 4
 • Last Update 28 Oct 2006
• http://pear.php.net/package/XML_RPC2/
 • PHP 5 Only



                                          10
SOAP

• Developed, Maintained, and Recommended
  by W3C
 • http://www.w3.org/TR/soap/
• Originally “Simple Object Access Protocol”
• Now it is just “SOAP”
 • Probably because it is not very simple...



                                               11
SOAP + WSDL

• WSDL = Yet another W3 Standard
 • “Web Service Description Language”
 • http://www.w3.org/TR/wsdl/
• Used to expose SOAP web services
 • SOAP w/o WSDL means more typing
 • SOAP w/WSDL means less work



                                        12
SOAP + WSDL

• WSDL = Yet another W3 Standard
 • “Web Service Description Language”
 • http://www.w3.org/TR/wsdl/
• Used to expose SOAP web services
 • SOAP w/o WSDL means more typing
 • SOAP w/WSDL means less work



                                        13
Consuming Soap Services
$clientOptions = array(

 ‘uri’ => ‘http://host/server/’,

 ‘location’ => ‘http://host/server/MathServer.php’
);

$Client = new SoapClient(NULL, $clientOptions);

$method = ‘add’;
$params = array(

 new SoapParam(12345, ‘number1’),

 new SoapParam(98765, ‘number2’)
);

echo $Client->__call($method, $params);




                                                      14
SOAP Libraries


$Client = new SoapClient(‘http://host/Math.wsdl’);

echo $Client->add(1234, 5678);




                                                     15
REST
• REST = “Representational State Transfer”
• Is not a standard
• ... but it does use standards
  • HTTP, URI, XML
• REST puts “Web” back into “Web Services”
  • The Internet is a REST system



                                             16
REST + URI

• REST puts the focus back into a URI rather
  than obscuring it behind an API
 • http://some-store.com/categories/
 • http://some-store.com/products/widget
 • http://some-store.com/search/gadgets




                                               17
Real Life Examples




                     18
del.icio.us

• Most popular social bookmarking utility
  • http://del.icio.us
• A property of Yahoo!
• Wicked simple REST API
  • http://del.icio.us/help/api/




                                            19
The del.icio.us API

• Update
  • https://api.del.icio.us/v1/posts/update
• Tags
  • https://api.del.icio.us/v1/tags/get
  • https://api.del.icio.us/v1/tags/rename




                                              20
The del.icio.us API

• Simple API = Simple Documentation
  • http://del.icio.us/help/api
• Uses HTTP Authentication
• Still under development




                                      21
The del.icio.us API
• Posts
  • https://api.del.icio.us/v1/posts/get
  • https://api.del.icio.us/v1/posts/recent
  • https://api.del.icio.us/v1/posts/all
  • https://api.del.icio.us/v1/posts/dates
  • https://api.del.icio.us/v1/posts/add
  • https://api.del.icio.us/v1/posts/delete


                                              22
The del.icio.us API


• Bundles
  • https://api.del.icio.us/v1/tags/bundles/all
  • https://api.del.icio.us/v1/tags/bundles/set
  • https://api.del.icio.us/v1/tags/bundles/delete




                                                     23

Mais conteúdo relacionado

Mais procurados

Easy rest service using PHP reflection api
Easy rest service using PHP reflection apiEasy rest service using PHP reflection api
Easy rest service using PHP reflection apiMatthieu Aubry
 
Webservice for android ppt
Webservice for android pptWebservice for android ppt
Webservice for android pptsantosh lamba
 
Best Practice in API Design
Best Practice in API DesignBest Practice in API Design
Best Practice in API DesignLorna Mitchell
 
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram VaswaniCreating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswanivvaswani
 
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLEREST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLEreneechemel
 
RESTful Web Services with JAX-RS
RESTful Web Services with JAX-RSRESTful Web Services with JAX-RS
RESTful Web Services with JAX-RSCarol McDonald
 
Introduction to Web Programming with Perl
Introduction to Web Programming with PerlIntroduction to Web Programming with Perl
Introduction to Web Programming with PerlDave Cross
 
Json-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webJson-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webkriszyp
 
Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reesebuildacloud
 
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey IntroductionseyCwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey Introductionseyelliando dias
 
Web Development in Perl
Web Development in PerlWeb Development in Perl
Web Development in PerlNaveen Gupta
 
Common Gateway Interface
Common Gateway InterfaceCommon Gateway Interface
Common Gateway InterfaceBalu Masulkar
 
Ruby HTTP clients comparison
Ruby HTTP clients comparisonRuby HTTP clients comparison
Ruby HTTP clients comparisonHiroshi Nakamura
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)Jef Claes
 

Mais procurados (20)

Easy rest service using PHP reflection api
Easy rest service using PHP reflection apiEasy rest service using PHP reflection api
Easy rest service using PHP reflection api
 
ASP.NET WEB API
ASP.NET WEB APIASP.NET WEB API
ASP.NET WEB API
 
Excellent rest using asp.net web api
Excellent rest using asp.net web apiExcellent rest using asp.net web api
Excellent rest using asp.net web api
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Webservice for android ppt
Webservice for android pptWebservice for android ppt
Webservice for android ppt
 
Best Practice in API Design
Best Practice in API DesignBest Practice in API Design
Best Practice in API Design
 
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram VaswaniCreating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
 
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLEREST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
 
RESTful Web Services with JAX-RS
RESTful Web Services with JAX-RSRESTful Web Services with JAX-RS
RESTful Web Services with JAX-RS
 
Introduction to Web Programming with Perl
Introduction to Web Programming with PerlIntroduction to Web Programming with Perl
Introduction to Web Programming with Perl
 
Json-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webJson-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the web
 
REST API Laravel
REST API LaravelREST API Laravel
REST API Laravel
 
Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reese
 
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey IntroductionseyCwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
 
Web Development in Perl
Web Development in PerlWeb Development in Perl
Web Development in Perl
 
PHP FUNCTIONS
PHP FUNCTIONSPHP FUNCTIONS
PHP FUNCTIONS
 
SOAP-based Web Services
SOAP-based Web ServicesSOAP-based Web Services
SOAP-based Web Services
 
Common Gateway Interface
Common Gateway InterfaceCommon Gateway Interface
Common Gateway Interface
 
Ruby HTTP clients comparison
Ruby HTTP clients comparisonRuby HTTP clients comparison
Ruby HTTP clients comparison
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
 

Destaque

Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP TutorialLorna Mitchell
 
PHP and Web Services
PHP and Web ServicesPHP and Web Services
PHP and Web ServicesBruno Pedro
 
RESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkRESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkBo-Yi Wu
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterSachin G Kulkarni
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using PhpSudheer Satyanarayana
 
Web Services (in portuguese)
Web Services (in portuguese)Web Services (in portuguese)
Web Services (in portuguese)Bruno Pedro
 
03 the htm_lforms
03 the htm_lforms03 the htm_lforms
03 the htm_lformsIIUM
 
Using arrays with PHP for forms and storing information
Using arrays with PHP for forms and storing informationUsing arrays with PHP for forms and storing information
Using arrays with PHP for forms and storing informationNicole Ryan
 
PHP Forms PHP 05
PHP Forms PHP 05PHP Forms PHP 05
PHP Forms PHP 05Spy Seat
 
SOA e Web Services
SOA e Web ServicesSOA e Web Services
SOA e Web Servicessergiocrespo
 
Advanced Web Services Hacking (AusCERT 06)
Advanced Web Services Hacking (AusCERT 06)Advanced Web Services Hacking (AusCERT 06)
Advanced Web Services Hacking (AusCERT 06)Shreeraj Shah
 
Web Service and PHP, REST and SOAP
Web Service and PHP, REST and SOAPWeb Service and PHP, REST and SOAP
Web Service and PHP, REST and SOAPElwin Huaman
 
Chapter 07 php forms handling
Chapter 07   php forms handlingChapter 07   php forms handling
Chapter 07 php forms handlingDhani Ahmad
 
Php creating forms
Php creating formsPhp creating forms
Php creating formsargusacademy
 
Criando e consumindo webservice REST com PHP e JSON
Criando e consumindo webservice REST com PHP e JSONCriando e consumindo webservice REST com PHP e JSON
Criando e consumindo webservice REST com PHP e JSONMarcio Junior Vieira
 
Forms and Databases in PHP
Forms and Databases in PHPForms and Databases in PHP
Forms and Databases in PHPMike Crabb
 
Mini Curso Web Services com PHP
Mini Curso Web Services com PHPMini Curso Web Services com PHP
Mini Curso Web Services com PHPelliando dias
 
Creating Mobile Apps With PHP & Symfony2
Creating Mobile Apps With PHP & Symfony2Creating Mobile Apps With PHP & Symfony2
Creating Mobile Apps With PHP & Symfony2Pablo Godel
 

Destaque (20)

Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
 
PHP and Web Services
PHP and Web ServicesPHP and Web Services
PHP and Web Services
 
RESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkRESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP Framework
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using Php
 
Web Services (in portuguese)
Web Services (in portuguese)Web Services (in portuguese)
Web Services (in portuguese)
 
03 the htm_lforms
03 the htm_lforms03 the htm_lforms
03 the htm_lforms
 
Using arrays with PHP for forms and storing information
Using arrays with PHP for forms and storing informationUsing arrays with PHP for forms and storing information
Using arrays with PHP for forms and storing information
 
PHP Forms PHP 05
PHP Forms PHP 05PHP Forms PHP 05
PHP Forms PHP 05
 
SOA e Web Services
SOA e Web ServicesSOA e Web Services
SOA e Web Services
 
Advanced Web Services Hacking (AusCERT 06)
Advanced Web Services Hacking (AusCERT 06)Advanced Web Services Hacking (AusCERT 06)
Advanced Web Services Hacking (AusCERT 06)
 
Web Service and PHP, REST and SOAP
Web Service and PHP, REST and SOAPWeb Service and PHP, REST and SOAP
Web Service and PHP, REST and SOAP
 
Chapter 07 php forms handling
Chapter 07   php forms handlingChapter 07   php forms handling
Chapter 07 php forms handling
 
3 php forms
3 php forms3 php forms
3 php forms
 
Php forms
Php formsPhp forms
Php forms
 
Php creating forms
Php creating formsPhp creating forms
Php creating forms
 
Criando e consumindo webservice REST com PHP e JSON
Criando e consumindo webservice REST com PHP e JSONCriando e consumindo webservice REST com PHP e JSON
Criando e consumindo webservice REST com PHP e JSON
 
Forms and Databases in PHP
Forms and Databases in PHPForms and Databases in PHP
Forms and Databases in PHP
 
Mini Curso Web Services com PHP
Mini Curso Web Services com PHPMini Curso Web Services com PHP
Mini Curso Web Services com PHP
 
Creating Mobile Apps With PHP & Symfony2
Creating Mobile Apps With PHP & Symfony2Creating Mobile Apps With PHP & Symfony2
Creating Mobile Apps With PHP & Symfony2
 

Semelhante a Creating And Consuming Web Services In Php 5

EcoSystem Tools for Admins - AtlasCamp 2011
EcoSystem Tools for Admins - AtlasCamp 2011EcoSystem Tools for Admins - AtlasCamp 2011
EcoSystem Tools for Admins - AtlasCamp 2011Atlassian
 
Open Ap Is State Of The Market
Open Ap Is State Of The MarketOpen Ap Is State Of The Market
Open Ap Is State Of The MarketConSanFrancisco123
 
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScaleGDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScalePatrick Chanezon
 
Apache Solr Changes the Way You Build Sites
Apache Solr Changes the Way You Build SitesApache Solr Changes the Way You Build Sites
Apache Solr Changes the Way You Build SitesPeter
 
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsThe liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsJorge Ferrer
 
Whitebox Testing for Blackbox Testers: Simplifying API Testing
Whitebox Testing for Blackbox Testers: Simplifying API TestingWhitebox Testing for Blackbox Testers: Simplifying API Testing
Whitebox Testing for Blackbox Testers: Simplifying API TestingQASymphony
 
Integrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIntegrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIvo Jansch
 
Entity Linking and REST Patterns in SOA
Entity Linking and REST Patterns in SOA Entity Linking and REST Patterns in SOA
Entity Linking and REST Patterns in SOA WSO2
 
APC Hackathon 2017 Open Bank Project workshop
APC Hackathon 2017 Open Bank Project workshopAPC Hackathon 2017 Open Bank Project workshop
APC Hackathon 2017 Open Bank Project workshopsimonredfern
 
Open Bank Project Presentation Tel Aviv CA 4th April 2017
Open Bank Project Presentation Tel Aviv CA 4th April 2017 Open Bank Project Presentation Tel Aviv CA 4th April 2017
Open Bank Project Presentation Tel Aviv CA 4th April 2017 simonredfern
 
Open Social Summit Korea Overview
Open Social Summit Korea OverviewOpen Social Summit Korea Overview
Open Social Summit Korea OverviewChris Schalk
 
Maine WordPress Meetup JSON REST API, 3/16/2016
Maine WordPress Meetup JSON REST API, 3/16/2016Maine WordPress Meetup JSON REST API, 3/16/2016
Maine WordPress Meetup JSON REST API, 3/16/2016Andre Gagnon
 
Delivering High Performance Websites with NGINX
Delivering High Performance Websites with NGINXDelivering High Performance Websites with NGINX
Delivering High Performance Websites with NGINXNGINX, Inc.
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service ArchitectureEduards Sizovs
 
Web Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureWeb Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureToru Kawamura
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Shaer Hassan
 

Semelhante a Creating And Consuming Web Services In Php 5 (20)

EcoSystem Tools for Admins - AtlasCamp 2011
EcoSystem Tools for Admins - AtlasCamp 2011EcoSystem Tools for Admins - AtlasCamp 2011
EcoSystem Tools for Admins - AtlasCamp 2011
 
Open Ap Is State Of The Market
Open Ap Is State Of The MarketOpen Ap Is State Of The Market
Open Ap Is State Of The Market
 
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScaleGDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
 
Apache Solr Changes the Way You Build Sites
Apache Solr Changes the Way You Build SitesApache Solr Changes the Way You Build Sites
Apache Solr Changes the Way You Build Sites
 
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsThe liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
 
Understanding Web services
Understanding Web servicesUnderstanding Web services
Understanding Web services
 
Whitebox Testing for Blackbox Testers: Simplifying API Testing
Whitebox Testing for Blackbox Testers: Simplifying API TestingWhitebox Testing for Blackbox Testers: Simplifying API Testing
Whitebox Testing for Blackbox Testers: Simplifying API Testing
 
Integrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIntegrating PHP With System-i using Web Services
Integrating PHP With System-i using Web Services
 
Web Based APIs
Web Based APIsWeb Based APIs
Web Based APIs
 
Entity Linking and REST Patterns in SOA
Entity Linking and REST Patterns in SOA Entity Linking and REST Patterns in SOA
Entity Linking and REST Patterns in SOA
 
APC Hackathon 2017 Open Bank Project workshop
APC Hackathon 2017 Open Bank Project workshopAPC Hackathon 2017 Open Bank Project workshop
APC Hackathon 2017 Open Bank Project workshop
 
Open Bank Project Presentation Tel Aviv CA 4th April 2017
Open Bank Project Presentation Tel Aviv CA 4th April 2017 Open Bank Project Presentation Tel Aviv CA 4th April 2017
Open Bank Project Presentation Tel Aviv CA 4th April 2017
 
Open Social Summit Korea Overview
Open Social Summit Korea OverviewOpen Social Summit Korea Overview
Open Social Summit Korea Overview
 
Maine WordPress Meetup JSON REST API, 3/16/2016
Maine WordPress Meetup JSON REST API, 3/16/2016Maine WordPress Meetup JSON REST API, 3/16/2016
Maine WordPress Meetup JSON REST API, 3/16/2016
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
 
Delivering High Performance Websites with NGINX
Delivering High Performance Websites with NGINXDelivering High Performance Websites with NGINX
Delivering High Performance Websites with NGINX
 
To SPA or not to SPA
To SPA or not to SPATo SPA or not to SPA
To SPA or not to SPA
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service Architecture
 
Web Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureWeb Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the future
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09
 

Mais de Michael Girouard

Day to Day Realities of an Independent Worker
Day to Day Realities of an Independent WorkerDay to Day Realities of an Independent Worker
Day to Day Realities of an Independent WorkerMichael Girouard
 
Object Oriented JavaScript
Object Oriented JavaScriptObject Oriented JavaScript
Object Oriented JavaScriptMichael Girouard
 
JavaScript From Scratch: Writing Java Script Applications
JavaScript From Scratch: Writing Java Script ApplicationsJavaScript From Scratch: Writing Java Script Applications
JavaScript From Scratch: Writing Java Script ApplicationsMichael Girouard
 
JavaScript From Scratch: Events
JavaScript From Scratch: EventsJavaScript From Scratch: Events
JavaScript From Scratch: EventsMichael Girouard
 
JavaScript From Scratch: Playing With Data
JavaScript From Scratch: Playing With DataJavaScript From Scratch: Playing With Data
JavaScript From Scratch: Playing With DataMichael Girouard
 
JavaScript from Scratch: Getting Your Feet Wet
JavaScript from Scratch: Getting Your Feet WetJavaScript from Scratch: Getting Your Feet Wet
JavaScript from Scratch: Getting Your Feet WetMichael Girouard
 
A Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented PhpA Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented PhpMichael Girouard
 
Learning To Love Java Script
Learning To Love Java ScriptLearning To Love Java Script
Learning To Love Java ScriptMichael Girouard
 
Learning To Love Java Script Color
Learning To Love Java Script ColorLearning To Love Java Script Color
Learning To Love Java Script ColorMichael Girouard
 

Mais de Michael Girouard (17)

Day to Day Realities of an Independent Worker
Day to Day Realities of an Independent WorkerDay to Day Realities of an Independent Worker
Day to Day Realities of an Independent Worker
 
Responsible JavaScript
Responsible JavaScriptResponsible JavaScript
Responsible JavaScript
 
Object Oriented JavaScript
Object Oriented JavaScriptObject Oriented JavaScript
Object Oriented JavaScript
 
The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
 
Ajax for PHP Developers
Ajax for PHP DevelopersAjax for PHP Developers
Ajax for PHP Developers
 
JavaScript From Scratch: Writing Java Script Applications
JavaScript From Scratch: Writing Java Script ApplicationsJavaScript From Scratch: Writing Java Script Applications
JavaScript From Scratch: Writing Java Script Applications
 
JavaScript From Scratch: Events
JavaScript From Scratch: EventsJavaScript From Scratch: Events
JavaScript From Scratch: Events
 
JavaScript From Scratch: Playing With Data
JavaScript From Scratch: Playing With DataJavaScript From Scratch: Playing With Data
JavaScript From Scratch: Playing With Data
 
JavaScript from Scratch: Getting Your Feet Wet
JavaScript from Scratch: Getting Your Feet WetJavaScript from Scratch: Getting Your Feet Wet
JavaScript from Scratch: Getting Your Feet Wet
 
Its More Than Just Markup
Its More Than Just MarkupIts More Than Just Markup
Its More Than Just Markup
 
Web Standards Evangelism
Web Standards EvangelismWeb Standards Evangelism
Web Standards Evangelism
 
A Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented PhpA Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented Php
 
A Look At Flex And Php
A Look At Flex And PhpA Look At Flex And Php
A Look At Flex And Php
 
Baking Cakes With Php
Baking Cakes With PhpBaking Cakes With Php
Baking Cakes With Php
 
Cfphp Zce 01 Basics
Cfphp Zce 01 BasicsCfphp Zce 01 Basics
Cfphp Zce 01 Basics
 
Learning To Love Java Script
Learning To Love Java ScriptLearning To Love Java Script
Learning To Love Java Script
 
Learning To Love Java Script Color
Learning To Love Java Script ColorLearning To Love Java Script Color
Learning To Love Java Script Color
 

Último

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 

Último (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 

Creating And Consuming Web Services In Php 5

  • 1. Creating and Consuming Web Services in PHP 5 Central Florida PHP 1
  • 2. Creating and Consuming Web Services in PHP 5 • Web Service Basics • Using Existing Web Services • Rolling Your Own Web Service 2
  • 4. What are Web Services? • According to WikiPedia • “Web Services are frequently just Web APIs that can be accessed over a network, such as the Internet, and executed on a remote system hosting the requested services” 4
  • 5. What are Web Services? • ...in fewer words • “Web Services are a way to send and receive information between remote programs.” 5
  • 6. What are Web Services Good For? 6
  • 7. What are Web Services Good For? Resource 6
  • 8. What are Web Services Good For? Consumer Resource 6
  • 9. What are Web Services Good For? Consumer Resource Consumer Consumer Consumer 6
  • 10. What are Web Services Good For? Consumer Resource Consumer Consumer Consumer 6
  • 11. What are Web Services Good For? Consumer Resource Consumer Consumer Consumer 6
  • 12. What are Web Services Good For? Consumer Resource Consumer Consumer Consumer 6
  • 13. What are Web Services Good For? Consumer Resource Consumer Consumer Consumer 6
  • 14. What are Web Services Good For? Consumer Resource Consumer Consumer Consumer 6
  • 15. Types of Web Services • XML-RPC • SOAP • REST • Free-form 7
  • 16. XML-RPC • RPC = Remote Procedure Call • The “Grandfather” of XML-based RPC services • Hence it’s name • Since 1998 • A precursor to SOAP 8
  • 17. XML-RPC Libraries • http://php.net/xmlrpc/ • Native PHP support since 4.1.0 • Not enabled by default • Documentation Sucks • http://phpxmlrpc.sourceforge.net/ • Useful, Inc (Who also brought you XML-RPC) 9
  • 18. XML-RPC Libraries • http://pear.php.net/package/XML_RPC/ • The classic, tried and true library • PHP 4 • Last Update 28 Oct 2006 • http://pear.php.net/package/XML_RPC2/ • PHP 5 Only 10
  • 19. SOAP • Developed, Maintained, and Recommended by W3C • http://www.w3.org/TR/soap/ • Originally “Simple Object Access Protocol” • Now it is just “SOAP” • Probably because it is not very simple... 11
  • 20. SOAP + WSDL • WSDL = Yet another W3 Standard • “Web Service Description Language” • http://www.w3.org/TR/wsdl/ • Used to expose SOAP web services • SOAP w/o WSDL means more typing • SOAP w/WSDL means less work 12
  • 21. SOAP + WSDL • WSDL = Yet another W3 Standard • “Web Service Description Language” • http://www.w3.org/TR/wsdl/ • Used to expose SOAP web services • SOAP w/o WSDL means more typing • SOAP w/WSDL means less work 13
  • 22. Consuming Soap Services $clientOptions = array( ‘uri’ => ‘http://host/server/’, ‘location’ => ‘http://host/server/MathServer.php’ ); $Client = new SoapClient(NULL, $clientOptions); $method = ‘add’; $params = array( new SoapParam(12345, ‘number1’), new SoapParam(98765, ‘number2’) ); echo $Client->__call($method, $params); 14
  • 23. SOAP Libraries $Client = new SoapClient(‘http://host/Math.wsdl’); echo $Client->add(1234, 5678); 15
  • 24. REST • REST = “Representational State Transfer” • Is not a standard • ... but it does use standards • HTTP, URI, XML • REST puts “Web” back into “Web Services” • The Internet is a REST system 16
  • 25. REST + URI • REST puts the focus back into a URI rather than obscuring it behind an API • http://some-store.com/categories/ • http://some-store.com/products/widget • http://some-store.com/search/gadgets 17
  • 27. del.icio.us • Most popular social bookmarking utility • http://del.icio.us • A property of Yahoo! • Wicked simple REST API • http://del.icio.us/help/api/ 19
  • 28. The del.icio.us API • Update • https://api.del.icio.us/v1/posts/update • Tags • https://api.del.icio.us/v1/tags/get • https://api.del.icio.us/v1/tags/rename 20
  • 29. The del.icio.us API • Simple API = Simple Documentation • http://del.icio.us/help/api • Uses HTTP Authentication • Still under development 21
  • 30. The del.icio.us API • Posts • https://api.del.icio.us/v1/posts/get • https://api.del.icio.us/v1/posts/recent • https://api.del.icio.us/v1/posts/all • https://api.del.icio.us/v1/posts/dates • https://api.del.icio.us/v1/posts/add • https://api.del.icio.us/v1/posts/delete 22
  • 31. The del.icio.us API • Bundles • https://api.del.icio.us/v1/tags/bundles/all • https://api.del.icio.us/v1/tags/bundles/set • https://api.del.icio.us/v1/tags/bundles/delete 23