SlideShare a Scribd company logo
1 of 33
Download to read offline
PHP and Web Services
      CITOT - May    20th   2007
   Bruno Pedro <bpedro@computer.org>
Summary
 • What is PHP?
 • Web Services
  • SOAP
  • REST
  • JSON
 • Conclusions
PHP and Web Services      2
What is PHP?

  • PHP: Hypertext Preprocessor
  • Open Source Web scripting language
  • Created in 1994
  • Syntax inherited from C, Java and Perl
  • Powerful, yet easy to learn
PHP and Web Services    3
How is PHP used?

  • Content Management
  • Forums
  • Blogging
  • Wiki
  • CRM
PHP and Web Services   4
Who uses PHP?




                              Source: Zend



PHP and Web Services   5
Why use PHP?

  • Used by 20M+ Web Sites around the globe
  • Community-maintained documentation
  • Code runs on UNIX, OSX and Windows
  • Backed commercially by Zend
  • Easy syntax
PHP and Web Services   6
The PHP language


                           Easy syntax!




PHP and Web Services   7
Creating a function
                           function declaration


                            return value


                            function call




PHP and Web Services   8
Creating a class
                           class declaration


                           public method




                            method call


PHP and Web Services   9
Web Services




                                  Source:The Server Side
                              (http://tinyurl.com/38umxt)

PHP and Web Services    10
What are Web Services?

  • Interoperable interactions
  • Calls are made over a network
  • Lots of different standards
  • Popular Web sites use them

PHP and Web Services   11
Requirements

  • PHP 5.2.2
  • SOAP
  • simplexml
  • DOM
  • JSON
PHP and Web Services   12
SOAP




                                     Source: Prentice Hall
                              (http://tinyurl.com/33dcch)


PHP and Web Services    13
SOAP

  • Simple Object Access Protocol
  • Usually an HTTP POST request
  • Call is encapsulated in XML
  • Response is an XML document
  • PHP handles everything
PHP and Web Services    14
Server implementation

                                               namespace




                                               start a server
                                        assign a class
                            handle incoming calls

PHP and Web Services   15
Client implementation
                                namespace




                                   endpoint



          display result

PHP and Web Services       16
Output
                                   namespace




                          result

PHP and Web Services     17
SOAP

  • Support for SOAP 1.1, 1.2 and WSDL 1.1
  • Handles simple and complex types
  • Very easy implementation
  • Output is quite bulky

PHP and Web Services    18
REST
      «interface»
                                    /calculator/sum/
       Resource
                               GET - perform a calculation
     GET
                               PUT - not used
     PUT
                               POST - not used
     POST
                               DELETE - not used
     DELETE




    http://example.com/calculator/sum/?x=121&y=233




PHP and Web Services      19
REST
  • Representational State Transfer
  • Usually an HTTP GET request
  • Call is made through GET parameters
  • Response is an XML document
  • Create response with DOM
  • Interpret response with simplexml
PHP and Web Services    20
Server implementation
                                handle incoming call



                                      create an
                                      XML document

                                             add elements

                            output result

PHP and Web Services   21
Client implementation

                                        endpoint

                                     arguments



                                 load XML document

            output result

PHP and Web Services        22
Output



                              result




PHP and Web Services     23
REST

  • Interaction needs to be implemented
  • XML schema must be know beforehand
  • Complex types not handled natively
  • Output is usually RSS

PHP and Web Services    24
JSON




                                 JSON Logo
                             Source: json.org




PHP and Web Services    25
JSON
  • JavaScript Object Notation
  • REST approach
  • Except response is not XML
  • Used on the client side
  • Create response with json_encode()
  • Interpret response in JavaScript
PHP and Web Services    26
Server implementation

                            handle incoming call



                                         generate result


                                          output
                                          JSON string

PHP and Web Services   27
Client implementation
                                            endpoint



                                                       arguments




                       output result


PHP and Web Services                   28
Output



                              result




PHP and Web Services     29
JSON

  • REST approach
  • Handles simple and complex types
  • Calls can be made with AJAX
  • Can also be used on the server side

PHP and Web Services    30
Conclusions
  • PHP is a powerful web scripting language
  • Too many Web Services standards
  • PHP handles all the internals
  • REST requires more coding than SOAP
  • Use JSON for client side applications
  • XML-RPC support is still experimental
PHP and Web Services        31
Questions?




PHP and Web Services       32
Resources
  • My blog: http://unfoldingtheweb.com/

  • PHP Manual: http://www.php.net/
  • SOAP: http://www.w3.org/TR/soap/
  • REST: http://tinyurl.com/akhc7
  • JSON: http://www.json.org/
PHP and Web Services       33

More Related Content

Viewers also liked

三百多个桥梁工程专有名词术语解释
三百多个桥梁工程专有名词术语解释三百多个桥梁工程专有名词术语解释
三百多个桥梁工程专有名词术语解释undral13
 
2nd international Schools China 2016 Nov 16-18
2nd international Schools China 2016   Nov 16-182nd international Schools China 2016   Nov 16-18
2nd international Schools China 2016 Nov 16-18zamibianzon
 
How to create the life you want
How to create the life you wantHow to create the life you want
How to create the life you wantSelf-employed
 
02 july-2014 to-08-july-2014-hindu_sabhavarta_year38_issue14
02 july-2014 to-08-july-2014-hindu_sabhavarta_year38_issue1402 july-2014 to-08-july-2014-hindu_sabhavarta_year38_issue14
02 july-2014 to-08-july-2014-hindu_sabhavarta_year38_issue14Akhil Bharat Mahasabha
 
International trade course 3
International trade course 3International trade course 3
International trade course 3Yudy Yunardy
 
Avaya sipwithinyourenterprise-090629022848-phpapp02
Avaya sipwithinyourenterprise-090629022848-phpapp02Avaya sipwithinyourenterprise-090629022848-phpapp02
Avaya sipwithinyourenterprise-090629022848-phpapp02Newlink
 
Answers in environmental education @kaye
Answers in environmental education @kayeAnswers in environmental education @kaye
Answers in environmental education @kayeCee Saliendrez
 
The Invention of Capitalism - Michael Perelman
The Invention of Capitalism - Michael PerelmanThe Invention of Capitalism - Michael Perelman
The Invention of Capitalism - Michael Perelmanberat celik
 
Clinical analysis report 14
Clinical analysis report 14Clinical analysis report 14
Clinical analysis report 14Nikee McEyes
 
Building Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience ManagerBuilding Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience Managerconnectwebex
 
Yellow Slice Design Profile - 2016
Yellow Slice Design Profile - 2016Yellow Slice Design Profile - 2016
Yellow Slice Design Profile - 2016Yellow Slice
 
CCP's Mishu System Tsai and Dean
CCP's Mishu System Tsai and DeanCCP's Mishu System Tsai and Dean
CCP's Mishu System Tsai and DeanSAINBAYAR Beejin
 
Welcome to my school
Welcome to my schoolWelcome to my school
Welcome to my schoolmezoszaki
 
Lean manufacturin
Lean manufacturinLean manufacturin
Lean manufacturinDana Feo
 

Viewers also liked (20)

三百多个桥梁工程专有名词术语解释
三百多个桥梁工程专有名词术语解释三百多个桥梁工程专有名词术语解释
三百多个桥梁工程专有名词术语解释
 
Apuntes
ApuntesApuntes
Apuntes
 
Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...
Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...
Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...
 
2nd international Schools China 2016 Nov 16-18
2nd international Schools China 2016   Nov 16-182nd international Schools China 2016   Nov 16-18
2nd international Schools China 2016 Nov 16-18
 
How to create the life you want
How to create the life you wantHow to create the life you want
How to create the life you want
 
Granada425
Granada425Granada425
Granada425
 
02 july-2014 to-08-july-2014-hindu_sabhavarta_year38_issue14
02 july-2014 to-08-july-2014-hindu_sabhavarta_year38_issue1402 july-2014 to-08-july-2014-hindu_sabhavarta_year38_issue14
02 july-2014 to-08-july-2014-hindu_sabhavarta_year38_issue14
 
International trade course 3
International trade course 3International trade course 3
International trade course 3
 
Avaya sipwithinyourenterprise-090629022848-phpapp02
Avaya sipwithinyourenterprise-090629022848-phpapp02Avaya sipwithinyourenterprise-090629022848-phpapp02
Avaya sipwithinyourenterprise-090629022848-phpapp02
 
Answers in environmental education @kaye
Answers in environmental education @kayeAnswers in environmental education @kaye
Answers in environmental education @kaye
 
The Invention of Capitalism - Michael Perelman
The Invention of Capitalism - Michael PerelmanThe Invention of Capitalism - Michael Perelman
The Invention of Capitalism - Michael Perelman
 
Seven indicators of business failure
Seven indicators of business failureSeven indicators of business failure
Seven indicators of business failure
 
Clinical analysis report 14
Clinical analysis report 14Clinical analysis report 14
Clinical analysis report 14
 
Building Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience ManagerBuilding Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience Manager
 
Phone list
Phone listPhone list
Phone list
 
Yellow Slice Design Profile - 2016
Yellow Slice Design Profile - 2016Yellow Slice Design Profile - 2016
Yellow Slice Design Profile - 2016
 
CCP's Mishu System Tsai and Dean
CCP's Mishu System Tsai and DeanCCP's Mishu System Tsai and Dean
CCP's Mishu System Tsai and Dean
 
Welcome to my school
Welcome to my schoolWelcome to my school
Welcome to my school
 
Ngaputaw ppt
Ngaputaw pptNgaputaw ppt
Ngaputaw ppt
 
Lean manufacturin
Lean manufacturinLean manufacturin
Lean manufacturin
 

Similar to Php And Web Services

Php and-web-services-24402
Php and-web-services-24402Php and-web-services-24402
Php and-web-services-24402PrinceGuru MS
 
Php and webservices
Php and webservicesPhp and webservices
Php and webservicesmcanotes
 
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
 
DPC2007 Zend Framework (Gaylord Aulke)
DPC2007 Zend Framework (Gaylord Aulke)DPC2007 Zend Framework (Gaylord Aulke)
DPC2007 Zend Framework (Gaylord Aulke)dpc
 
Introduction to Server-Side Development with PHP.ppt
Introduction to Server-Side Development with PHP.pptIntroduction to Server-Side Development with PHP.ppt
Introduction to Server-Side Development with PHP.pptDestaBelayneh1
 
2008 Ajax World Conference
2008 Ajax World Conference2008 Ajax World Conference
2008 Ajax World Conferencerajivmordani
 
State Of PHP - Zeev Suraski
State Of PHP - Zeev SuraskiState Of PHP - Zeev Suraski
State Of PHP - Zeev Suraskidpc
 
SydPHP March 2012 Meetup
SydPHP March 2012 MeetupSydPHP March 2012 Meetup
SydPHP March 2012 MeetupGraham Weldon
 
Simple Web Services with PHP
Simple Web Services with PHPSimple Web Services with PHP
Simple Web Services with PHPJohn Paul Ada
 
LF_OVS_17_OvS manipulation with Go at DigitalOcean
LF_OVS_17_OvS manipulation with Go at DigitalOceanLF_OVS_17_OvS manipulation with Go at DigitalOcean
LF_OVS_17_OvS manipulation with Go at DigitalOceanLF_OpenvSwitch
 
PHP MySQL Training : Module 2
PHP MySQL Training : Module 2PHP MySQL Training : Module 2
PHP MySQL Training : Module 2hussulinux
 
Using RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocolUsing RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocolTho Q Luong Luong
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptnohuhu
 
PHP And Silverlight - DevDays session
PHP And Silverlight - DevDays sessionPHP And Silverlight - DevDays session
PHP And Silverlight - DevDays sessionMaarten Balliauw
 
HAProxy tech talk
HAProxy tech talkHAProxy tech talk
HAProxy tech talkicebourg
 
Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Combell NV
 

Similar to Php And Web Services (20)

Php and-web-services-24402
Php and-web-services-24402Php and-web-services-24402
Php and-web-services-24402
 
Php and webservices
Php and webservicesPhp and webservices
Php and webservices
 
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
 
DPC2007 Zend Framework (Gaylord Aulke)
DPC2007 Zend Framework (Gaylord Aulke)DPC2007 Zend Framework (Gaylord Aulke)
DPC2007 Zend Framework (Gaylord Aulke)
 
Building Web Services
Building Web ServicesBuilding Web Services
Building Web Services
 
Introduction to Server-Side Development with PHP.ppt
Introduction to Server-Side Development with PHP.pptIntroduction to Server-Side Development with PHP.ppt
Introduction to Server-Side Development with PHP.ppt
 
2008 Ajax World Conference
2008 Ajax World Conference2008 Ajax World Conference
2008 Ajax World Conference
 
State Of PHP - Zeev Suraski
State Of PHP - Zeev SuraskiState Of PHP - Zeev Suraski
State Of PHP - Zeev Suraski
 
Understanding Web services
Understanding Web servicesUnderstanding Web services
Understanding Web services
 
SydPHP March 2012 Meetup
SydPHP March 2012 MeetupSydPHP March 2012 Meetup
SydPHP March 2012 Meetup
 
Simple Web Services with PHP
Simple Web Services with PHPSimple Web Services with PHP
Simple Web Services with PHP
 
LF_OVS_17_OvS manipulation with Go at DigitalOcean
LF_OVS_17_OvS manipulation with Go at DigitalOceanLF_OVS_17_OvS manipulation with Go at DigitalOcean
LF_OVS_17_OvS manipulation with Go at DigitalOcean
 
PHP MySQL Training : Module 2
PHP MySQL Training : Module 2PHP MySQL Training : Module 2
PHP MySQL Training : Module 2
 
Using RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocolUsing RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocol
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
 
Nodejsvs
NodejsvsNodejsvs
Nodejsvs
 
PHP And Silverlight - DevDays session
PHP And Silverlight - DevDays sessionPHP And Silverlight - DevDays session
PHP And Silverlight - DevDays session
 
Datasnap
DatasnapDatasnap
Datasnap
 
HAProxy tech talk
HAProxy tech talkHAProxy tech talk
HAProxy tech talk
 
Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...
 

More from thinkphp

Knut Morris Pratt Algorithm
Knut Morris Pratt AlgorithmKnut Morris Pratt Algorithm
Knut Morris Pratt Algorithmthinkphp
 
String kmp
String kmpString kmp
String kmpthinkphp
 
String searching
String searching String searching
String searching thinkphp
 
Functional programming in java script
Functional programming in java scriptFunctional programming in java script
Functional programming in java scriptthinkphp
 
Practical functional java script
Practical functional java scriptPractical functional java script
Practical functional java scriptthinkphp
 
Javascript patterns
Javascript patternsJavascript patterns
Javascript patternsthinkphp
 
Placemaker
PlacemakerPlacemaker
Placemakerthinkphp
 
PHP 5.3 And PHP 6 A Look Ahead
PHP 5.3 And PHP 6 A Look AheadPHP 5.3 And PHP 6 A Look Ahead
PHP 5.3 And PHP 6 A Look Aheadthinkphp
 
Atom Web Services
Atom Web ServicesAtom Web Services
Atom Web Servicesthinkphp
 
Json Rpc Proxy Generation With Php
Json Rpc Proxy Generation With PhpJson Rpc Proxy Generation With Php
Json Rpc Proxy Generation With Phpthinkphp
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
Ajax Introduction Presentation
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentationthinkphp
 
Principii Poo
Principii PooPrincipii Poo
Principii Poothinkphp
 

More from thinkphp (14)

Knut Morris Pratt Algorithm
Knut Morris Pratt AlgorithmKnut Morris Pratt Algorithm
Knut Morris Pratt Algorithm
 
String kmp
String kmpString kmp
String kmp
 
String searching
String searching String searching
String searching
 
Functional programming in java script
Functional programming in java scriptFunctional programming in java script
Functional programming in java script
 
Practical functional java script
Practical functional java scriptPractical functional java script
Practical functional java script
 
Javascript patterns
Javascript patternsJavascript patterns
Javascript patterns
 
Placemaker
PlacemakerPlacemaker
Placemaker
 
PHP 5.3 And PHP 6 A Look Ahead
PHP 5.3 And PHP 6 A Look AheadPHP 5.3 And PHP 6 A Look Ahead
PHP 5.3 And PHP 6 A Look Ahead
 
Atom Web Services
Atom Web ServicesAtom Web Services
Atom Web Services
 
Json Rpc Proxy Generation With Php
Json Rpc Proxy Generation With PhpJson Rpc Proxy Generation With Php
Json Rpc Proxy Generation With Php
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Ajax Introduction Presentation
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentation
 
OOP
OOPOOP
OOP
 
Principii Poo
Principii PooPrincipii Poo
Principii Poo
 

Recently uploaded

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
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.pptxRustici Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
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 DiscoveryTrustArc
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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 REVIEWERMadyBayot
 
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...Jeffrey Haguewood
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
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...Orbitshub
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
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...apidays
 
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 FMESafe 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 2024Victor Rentea
 

Recently uploaded (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 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
 
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...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
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...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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
 

Php And Web Services

  • 1. PHP and Web Services CITOT - May 20th 2007 Bruno Pedro <bpedro@computer.org>
  • 2. Summary • What is PHP? • Web Services • SOAP • REST • JSON • Conclusions PHP and Web Services 2
  • 3. What is PHP? • PHP: Hypertext Preprocessor • Open Source Web scripting language • Created in 1994 • Syntax inherited from C, Java and Perl • Powerful, yet easy to learn PHP and Web Services 3
  • 4. How is PHP used? • Content Management • Forums • Blogging • Wiki • CRM PHP and Web Services 4
  • 5. Who uses PHP? Source: Zend PHP and Web Services 5
  • 6. Why use PHP? • Used by 20M+ Web Sites around the globe • Community-maintained documentation • Code runs on UNIX, OSX and Windows • Backed commercially by Zend • Easy syntax PHP and Web Services 6
  • 7. The PHP language Easy syntax! PHP and Web Services 7
  • 8. Creating a function function declaration return value function call PHP and Web Services 8
  • 9. Creating a class class declaration public method method call PHP and Web Services 9
  • 10. Web Services Source:The Server Side (http://tinyurl.com/38umxt) PHP and Web Services 10
  • 11. What are Web Services? • Interoperable interactions • Calls are made over a network • Lots of different standards • Popular Web sites use them PHP and Web Services 11
  • 12. Requirements • PHP 5.2.2 • SOAP • simplexml • DOM • JSON PHP and Web Services 12
  • 13. SOAP Source: Prentice Hall (http://tinyurl.com/33dcch) PHP and Web Services 13
  • 14. SOAP • Simple Object Access Protocol • Usually an HTTP POST request • Call is encapsulated in XML • Response is an XML document • PHP handles everything PHP and Web Services 14
  • 15. Server implementation namespace start a server assign a class handle incoming calls PHP and Web Services 15
  • 16. Client implementation namespace endpoint display result PHP and Web Services 16
  • 17. Output namespace result PHP and Web Services 17
  • 18. SOAP • Support for SOAP 1.1, 1.2 and WSDL 1.1 • Handles simple and complex types • Very easy implementation • Output is quite bulky PHP and Web Services 18
  • 19. REST «interface» /calculator/sum/ Resource GET - perform a calculation GET PUT - not used PUT POST - not used POST DELETE - not used DELETE http://example.com/calculator/sum/?x=121&y=233 PHP and Web Services 19
  • 20. REST • Representational State Transfer • Usually an HTTP GET request • Call is made through GET parameters • Response is an XML document • Create response with DOM • Interpret response with simplexml PHP and Web Services 20
  • 21. Server implementation handle incoming call create an XML document add elements output result PHP and Web Services 21
  • 22. Client implementation endpoint arguments load XML document output result PHP and Web Services 22
  • 23. Output result PHP and Web Services 23
  • 24. REST • Interaction needs to be implemented • XML schema must be know beforehand • Complex types not handled natively • Output is usually RSS PHP and Web Services 24
  • 25. JSON JSON Logo Source: json.org PHP and Web Services 25
  • 26. JSON • JavaScript Object Notation • REST approach • Except response is not XML • Used on the client side • Create response with json_encode() • Interpret response in JavaScript PHP and Web Services 26
  • 27. Server implementation handle incoming call generate result output JSON string PHP and Web Services 27
  • 28. Client implementation endpoint arguments output result PHP and Web Services 28
  • 29. Output result PHP and Web Services 29
  • 30. JSON • REST approach • Handles simple and complex types • Calls can be made with AJAX • Can also be used on the server side PHP and Web Services 30
  • 31. Conclusions • PHP is a powerful web scripting language • Too many Web Services standards • PHP handles all the internals • REST requires more coding than SOAP • Use JSON for client side applications • XML-RPC support is still experimental PHP and Web Services 31
  • 33. Resources • My blog: http://unfoldingtheweb.com/ • PHP Manual: http://www.php.net/ • SOAP: http://www.w3.org/TR/soap/ • REST: http://tinyurl.com/akhc7 • JSON: http://www.json.org/ PHP and Web Services 33