PHP and Web Services
Upcoming SlideShare
Loading in...5
×
 

PHP and Web Services

on

  • 43,605 views

A walk through PHP and the implementation of SOAP, REST and JSON servers and clients using only native functions.

A walk through PHP and the implementation of SOAP, REST and JSON servers and clients using only native functions.

Statistics

Views

Total Views
43,605
Views on SlideShare
36,557
Embed Views
7,048

Actions

Likes
34
Downloads
1,924
Comments
3

35 Embeds 7,048

http://mauriziostorani.wordpress.com 3452
http://www.siamwebcity.com 2258
http://www.webub.com 814
http://www.aalizwel.com 118
http://www.prosoxi.com 89
http://eclipseplugincentral.blogspot.com 74
http://www.slideshare.net 57
http://eclipseplugincentral.blogspot.in 44
http://unfoldingtheweb.com 38
http://www.i-home.ro 24
http://apprentieweb.blogspot.com 13
http://www.techiegyan.com 12
http://aalizwel.com 9
http://eclipseplugincentral.blogspot.ru 5
http://localhost 5
http://translate.googleusercontent.com 5
http://www.linkedin.com 4
http://www.eclipseplugincentral.blogspot.com 3
http://eclipseplugincentral.blogspot.de 2
http://eclipseplugincentral.blogspot.nl 2
http://test.idoc.vn 2
http://eclipseplugincentral.blogspot.ca 2
http://www.google.co.in 2
http://webcache.googleusercontent.com 2
http://www.blogger.com 2
https://www.google.com 1
https://www.linkedin.com 1
https://www.google.fi 1
http://duniarusak.blogspot.com 1
http://feeds.feedburner.com 1
http://www.eclipseplugincentral.blogspot.sg 1
http://us-w1.rockmelt.com 1
http://eclipseplugincentral.blogspot.co.uk 1
http://eclipseplugincentral.blogspot.tw 1
http://tubemote.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Amazing in Simple Way...
    Are you sure you want to
    Your message goes here
    Processing…
  • Impressive presentation on ’PHP and Web Services'. You’ve shown your credibility on presentation with this slideshow. This one deserves thumbs up. I’m John, owner of www.freeringtones.ws/ . Hope to see more quality slides from you.

    Best wishes.
    Are you sure you want to
    Your message goes here
    Processing…
  • exceptional demonstration..convinced me to have a hardlook at my company model..amazing
    Anisa
    http://financejedi.com http://healthjedi.com
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

PHP and Web Services PHP and Web Services Presentation Transcript

  • 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