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

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
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 MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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 textsMaria Levchenko
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
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 AutomationSafe Software
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 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