WebServices Wars: Creating a basic webservice using Eclipse, php and apache

Posted by: Andrea Benini

Tagged in: webservices

Andrea Benini

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.

Now if you like to write down everything from scratch you can surely do but if you're working on a big project you're surely already using an IDE of some sort.

I've tried a lot of different commercial and open source IDEs and after a lot of evaluation I've choosen Eclipse because it's mature, stable (quite), reliable, studied for big enterprise class projects ...and I've a fast and huge pc with a ton of ram on it.

Eclipse is reliable, well known and supported, one of its major drawbacks are about system resources, it eats a lot of ram but if you've a recently updated PC with a good linux distro and a good amount of ram you can surely use it and you'll never go away from it. PHP folks will surely install PDT (http://www.eclipse.org/pdt/): PHP Development Toos Project for Eclipse, it's now a mature plugin for eclipse, reliable and suited for php professional development.

I don't wanna bother you about details on configuring eclipse/pdt/apache/php and so on (maybe another blog argument ?) I'll assume you've this configuration :

  • Eclipse and PDT up and running in your workstation, don't care about operating system but of course if you're using linux it's better :-) (gentoo linux like me even better). But I really don't care, just need Eclipse up and running
  • Web Tools Platform plugin for Eclipse, not really required but useful, it provides: web page editor inside Eclipse, WSDL editor, HTML Validators. WSDL editor is very important if you wish to create webservices with a GUI interface, if you're mastering xml/soap/rpc files and you want to write them on your own you're free to do this.
  • A webserver with php extension installed, Apache2 and PHP5 are used in this sample but every webserver suitable for php is good (here again, apache2 and php5 are better than everything else)
  • Common PHP knowledge and some Object Oriented programming skills, here used for these samples
  • Basic SOAP and WebServices knowledge, at least you need to know what they can do and what is this technology for, later you'll better understand soap after reading samples

This blog is just an intro and a "bill list of materials" before getting started

 

This is an intro, next article will be the first "hands on" with eclipse and WSDL creation
As usual feel free to ask and write down some comments when needed, hope it helps


Next, featuring: Episode 1: WebServices Wars: "The Phantom Menace": Creating the WebService WSDL file


Andrea Benini (Ben)

 

Comments (3)Add Comment
Dan Lopez
Try Zend Framework!
written by Dan Lopez, July 02, 2009
I built our web services framework at the Linux Foundation using Zend Framework in about a day. This included an API key infrastructure to allow 3rd party integration with some of our data. Total time for dev and testing was 3 days, production on the 4th.

I went away from SOAP and used only XML and XML-RPC for performance and maintainability. Also many developers get stuck with PHP5 and conflicts with NuSOAP libraries.

Sounds cool though.. Best of luck!
Andrea Benini
XML/SOAP Comparison
written by Andrea Benini, July 03, 2009
In the beginning I've tried XML-RPC and later SOAP, I saw the differences and benefits but at least nothing related to performances, I've chosen SOAP because I've found a lot of documentation about it, php builtin classes (SOAPClient/Server, ...) and some nice interface methods with different platforms (.NET, PHP itself, UNIX/Win32 C++ classes, ...).
I've tried NuSOAP at the beginning but I was not really impressed about that and even PHP5 Soap classes are native and not built on top of php code, I really hope php6 will leave definitions as they are or it could be really a mess.
I'd like to hear from you about performance, linux.com is my favorite site and I think your programming experience at linux foundation on heavy loaded servers may contribute to the discussion, Your comment is appreciated.
Dan Lopez
...
written by Dan Lopez, July 03, 2009
Most definitely. From my SugarCRM days, C++, C# and Java apps worked really well with SOAP. I just think for expedience sake, XML manifests are easier to develop across the board, especially when it comes to RESTful apps etc

Write comment
You must be logged in to post a comment. Please register if you do not have an account yet.

busy