Creating And Consuming Web Services In Php 5

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

3 Favorites

Creating And Consuming Web Services In Php 5 - Presentation Transcript

  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
  3. Web Service Basics 3
  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
  26. Real Life Examples 18
  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

+ Michael GirouardMichael Girouard, 3 years ago

custom

7925 views, 3 favs, 2 embeds more stats

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 7925
    • 7919 on SlideShare
    • 6 from embeds
  • Comments 1
  • Favorites 3
  • Downloads 158
Most viewed embeds
  • 5 views on http://lamp4u.blogspot.com
  • 1 views on file://

more

All embeds
  • 5 views on http://lamp4u.blogspot.com
  • 1 views on file://

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories