 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Lorna Mitchell's Blog: PHP London Conference In Review
by Chris Cornutt March 08, 2010 @ 08:26:45
For those not able to attend this year's PHP London Conference, you might check out a summary post Lorna Mitchell has recently added to her blog about her time there.
This year I had the privilege of speaking at this event [...] my talk was entitled "Best Practices in Web Service Design" although perhaps "Things I Wish Web Service Creators Would Consider Before Writing Unclear and Unstable Useless And Frustrating Services" would have been a better title.
This year's PHP London Conference was held on Friday, February 26th in London and had talks on regular expressions, mobile application development, cloud computing and database optimization. Check out the Joind.in page for the event to see comments left by those that attended.
voice your opinion now!
phpuk2010 conference webservice wraup
Matthew Weier O'Phinney's Blog: Responding to Different Content Types in RESTful ZF Apps
by Chris Cornutt March 05, 2010 @ 12:20:22
Continuing on from his previous articles on working with REST in Zend Framework applications (and making the endpoints for a web service) Matthew Weier O'Phinney has a new tutorial with the next logical step in the series, automatically responding to different content types in your application based on the content-type the client sends.
There's no reason you can't re-use your RESTful web service to support multiple formats. Zend Framework and PHP have plenty of tools to assist you in responding to different format requests, so don't limit yourself. With a small amount of work, you can make your controllers format agnostic, and ensure that you respond appropriately to different requests.
He talks about concerns you'll have to worry about when developing your service - grabbing teh raw input instead of the POST values (since most requests will be rawly POSTed) and what to pass that message to to decode it properly. In his example the Zend_Json and Zend_Config_Xml components make it simpler to handle the info and some code to get the results back into your script.
There's also some code for the other side of things - building the response and pushing it out to the correct views depending on the request content type, action and information.
voice your opinion now!
zendframework rest webservice contenttype json xml tutorial
Lorna Mitchell's Blog: PHP and JSON
by Chris Cornutt February 11, 2010 @ 10:55:06
Lorna Mitchell has taken a look at using JSON in PHP applications in a new post to her blog. More specifically, she looks at how to get it working and a downfall or two that comes with it.
This is a quick outline on working with JSON from PHP, which is actually pretty simple to do. This post has some examples on how to do it and what the results should look like. JSON stands for JavaScript Object Notation, and is widely used in many languages (not just JavaScript) for serialisation. It is particularly popular for use in web services.
She gives an example of the translation between a PHP array (of subarrays) out into a JSON message complete with grouping. She does mention one problem that using this data format has, though - the lack of typing information that comes along with the message details. That can mean the difference between an array being pushed in on the sending side and an object (from json_decode) coming out the other side. As noted in the comments, though, there's a second parameter for json_decode that tells it to force the output as an array instead (along with a mention of another helpful constant in PHP 5.3 - JSON_FORCE_OBJECT).
voice your opinion now!
json example object array webservice
NETTUTS.com: Working with RESTful Services in CodeIgniter
by Chris Cornutt February 04, 2010 @ 13:03:58
Phil Sturgeon has posted a new tutorial over on the NETTUTS.com site about working with REST services in CodeIgniter. He shows both sides of things - using REST services and making them.
CodeIgniter is becoming well known for its power as a PHP based web application framework, but it's not often that we see examples of it being used for anything else. Today we'll learn how we can use CodeIgniter to create a RESTful API for your existing web applications, and demonstrate how to interact with your own API or other RESTful web-services, such as Facebook and Twitter.
He has the sample code hosted over on his github account where you can pull down the source and follow along from the beginning. His application is created to be flexible enough for multiple output formats (xml, json, html) and respond correctly to the HTTP request types like GET, POST, PUT, DELETE. On the other side he shows how to consume the services via different methods like file_get_contents and cURL.
voice your opinion now!
rest webservice codeigniter tutorial consume create
Jeez Tech: Using APIs With PHP? Here Are Your Classes
by Chris Cornutt November 24, 2009 @ 09:57:53
Jeez Tech has a new post with a great (and long) list of PHP scripts to connect your application to any number of popular APIs out there.
Do you want to use an API but you are too lazy to write your own code to handle the requests? If you code in PHP as I do, then you will definitely need these classes. By using the classes listed here you will be able of using a great number of web services with an easy and documented way.
They link to libraries to work with the APIs for Alexa, Babelfish, Bing, eBay, Facebooks, Flickr, Linkedin, MSN, Twitter, Skype and Yahoo. They also mention PEAR and the role it plays in the foundation of many web service connections.
voice your opinion now!
api webservice class
TechChorus Blog: Create RESTful Applications Using The Zend Framework
by Chris Cornutt November 18, 2009 @ 11:09:32
New on the TechChorus blog there's a quick tutorial from Sudeer looking at making a RESTful web service with the Zend Framework.
The Zend Framework 1.9 release added a new feature - Zend_Rest_Controller. Zend_Rest_Controller and Zend_Rest_Route classes go hand in hand. In the previous versions of the Zend Framework, we have had the Zend_Rest_Server component. We still have. [...] In this article let us explore how to make use of Zend_Rest_Route and Zend_Rest_Controller to build a RESTful server application. Zend_Rest_Route routes the request to the appropriate module, controller and action depending on the HTTP request method and URI.
Written on the base of the quickstart project from the Zend Framework tutorial site, they create a simple REST service that handles the get, put, post and delete requests through a series of methods in the controller. A response is hard-coded for each and a few examples of how to call the service via curl commands.
voice your opinion now!
rest tutorial zendframework webservice
Matthew Weier O'Phinney's Blog: Building RESTful Services with Zend Framework
by Chris Cornutt November 09, 2009 @ 11:48:28
Matthew Weier O'Phinney has posted a "second part" of a group of articles he's doing on web services with the Zend Framework. In this new blog post he gets into more detail on setting up REST interfaces for your applications.
At its heart, REST simply dictates that a given resource have a unique address, and that you interact with that resource using HTTP verbs. [...] What the REST paradigm provides you is a simple, standard way to structure your CRUD (Create-Read-Update-Delete) applications. Due to the large number of REST clients available, it also means that if you follow the rules, you get a ton of interoperability with those clients.
He shows how to create a simple REST server with the Zend_Rest_Route package and touches briefly on the proper way for your script to respond to a request.
voice your opinion now!
rest webservice zendframework
Lorna Mitchell's Blog: Add a heartbeat method to your service
by Chris Cornutt October 29, 2009 @ 08:41:53
Lorna Mitchell has a last minute suggestion of something to add to your web service that can really help out when developers using the API need it - a heartbeat.
The heartbeat shouldn't require any particular parameters or any authentication, since formatting data and passing credentials can be a stumbling block for those integrating with a service for the first time or those debugging issues. The heartbeat method can return some known data, perhaps an "I'm here" message, and maybe some version information.
She points out Flickr's flickr.test.echo call that does nothing but return whatever was sent to it. This kind of method can be very useful for applications that might need constant contact with the API or, inversely, need to know when the API isn't there and switch to an offline mode. A consistent heartbeat makes it easy to check these sort of things and to be sure that you get consistent feedback from your requests.
voice your opinion now!
heartbeat method webservice
|
Community Events
Don't see your event here? Let us know!
|