Archive for February, 2007

Java, PHP, XML and AJAX (how to mix all together)

Introduction

Why does anyone want to mix all this stuff together? are you crazy? maybe i am :)
The main purpouse of this experiment is to test the real availability of this heterogeneus environments working together.

First of all, i want to explain in a nutshell what i’m going to to and how.

I’ll use the powerfull platform of Java to implemente all the application logic. In this test, the application logic will be very simple, but in real scenarios maybe we want to use advanced features like replication, clustering, relational databases, work with XMLs documents, operations like XSL-T, XPath, XQuery, and so on. And there isn’t a better solution than Java.

With PHP you can code big projects, but it doen’t have all the Java third party APIs and the big comunity of the open source. But always is interesting to use the strengths of each other, and the web services is a way to connect both.

In Java i’m going to use Apache Axis to expose a web service and in PHP i’m going to use NuSOAP API to connect to this web service.

And the last step is to use AJAX to improve the use experience. In the Java side, the choice for me is very clear, i would use DWR (of course), but in PHP side i decided to use an agnostic Javascript library, i’m going to use Dojo Toolkit.

Java and PHP
This is a flow of whole process, how the several libraries and APIs interconnect.

Read more »