Posted by: Andrea Benini
on July 02 2009
WebServices Wars: "The Phantom Menace": Creating the WebService WSDL file
Now if you've followed the introduction "
WebServices Wars: Creating a basic webservice using Eclipse, php and apache" you're now ready for Episode I
Intro
This webservice saga begins with the base of every good project: the planning and design phase.
Here's what I'm going to do:
- Create a WSDL definition file for the new service, it will be called sample.wsdl, it will be accessible from the following URL: http://my.website.com/sample.wsdl
- Create a webservice server called sample.php it will provide sample.wsdl implementation, it will act as a service for etherogeneous applications requiring for it from this url: http://my.website.com/sample.php
- Create a webservice client file, this is just for seeing some output and understand how php can access services, it doesn't matter if you plan to use php on the backend server or not. The url could be http://my.website.com/client.php
- Make some considerations on debugging techniques and caching in development environments and production areas
This example will use SOAP techniques, SOAP is quick and easy to use, PHP already provide native SOAP classes, they're fast and well written in low level, not an external php library for SOAP. Personally I don't like NuSoap or third party libs for PHP, native support is reliable, fast, documented and stable.
I'll assume you already know what a webservice is, what you can do with it and how to use it in a real environment, please read this intro if you need it, it's a nice starting point.
As W3C suggests you can create a webservice with or without WSDL definition file, but if you're planning a big project or you just want to make things easy and well documented I suggest you to use WSDL files from the beginning, it's more easy to understand internals and speeds up your programming
Interface
Our sample webservice will provide these methods:
Posted by: Andrea Benini
on July 02 2009
Here I am,
That's a lot of time since my last blog, well, I was quite busy with something else (still have my private life ok ?) but now I'm back again with WebServices, PHP, Eclipse, Apache.
A lot of folks are asking me about some sort of short howto/sample/easy doc for dealing with webservices and php, there's a lot of information spread all around the web so I've decided to collect information from my projects and write down some notes for a quickstart howto with webservices and php.