Book Image

RESTful PHP Web Services

By : Samisa Abeysinghe
Book Image

RESTful PHP Web Services

By: Samisa Abeysinghe

Overview of this book

<p>Representational State Transfer (REST) is a form of software architecture; systems that follow it are often called RESTful. It is the architectural style that drives the World Wide Web (the motivation for REST was to capture elements that made the Web successful), and RESTful web services use simple protocols already familiar to web developers. RESTful web services are found in lots of places with big name Web APIs such as Flickr, and Yahoo search following a REST-based approach.<br /><br />With any architectural style or approach, struggling with its basic concepts is just one problem – implementation in your favorite language is another, and that's where this book comes in. If you're a PHP developer, this book will show you how to create and consume RESTful web services in PHP, and make your services work well in the context of the Web.<br /><br />You will learn about the basic concepts of REST, and then look at PHP tools, libraries and techniques for working with RESTful web services. You will see how to use other RESTful services from your PHP applications, and also how to engineer your PHP applications to make them RESTful.<br /><br />This book is about implementing RESTful web services in PHP, and so the book is packed with example code and careful explanations.</p>
Table of Contents (15 chapters)
RESTful PHP Web Services
Credits
About the Author
About the Reviewers
Preface
Index

Appendix A. WSO2 Web Services Framework for PHP

WSO2 Web Services Framework for PHP (WSO2 WSF/PHP) is an open-source, enterprise grade PHP extension for providing and consuming web services in PHP. The home page for the project can be found at http://wso2.org/projects/wsf/php. WSO2 WSF/PHP is a complete solution for building and deploying web services and is the only PHP extension with the widest range of WS-* (also known as SOAP web services) specification implementations. It is also notable that it has a comprehensive REST support. You can implement a single service and expose it as both SOAP and REST service. Please refer to Chapter 1 for a recap of REST and SOAP comparison.

In Chapter 6 we introduced Zend Framework. The key difference between WSF/PHP and the Zend Framework is that, while Zend framework is a library written in PHP, WSF/PHP is a library written in C as a PHP extension. Also, while Zend Framework is a generic PHP library that also includes REST support. WSF/PHP is a web services specific framework that supports REST as well as SOAP services. You can use WSF/PHP as a REST framework alone or you can use it for SOAP web services that require quality of service aspects such as security and reliability.

Since WSF/PHP is implemented in C, you can expect to have better performance while using it as compared to using a library written in PHP alone such as Zend Framework. However, the performance gain comes with a cost, that being the complexity of installing compiled C libraries as a PHP extension. Whereas a library written in PHP, such as Zend Framework, can be just copied to the document root and you are ready to use it.