Thursday, August 30, 2007

PHP for Microsoft AJAX Library

With the release of Microsoft AJAX ASP.NET 1.0, Steve Marx pushed his project to help PHP applications make use of the Microsoft AJAX Library. PHP for Microsoft AJAX Library currently supports creating web service proxies in PHP code such that the Microsoft AJAX Library can call them from client-side code. Future releases will support localization and globalization, debug and release scripts, and more features inspired by ASP.NET AJAX. The library is in its alpha stage and require PHP 5.2 for json_encode/json_decode or you can manually install php-json.

I shipped the first public release of my own product today to coincide with ASP.NET AJAX 1.0. My project is called PHP for Microsoft AJAX Library, a small library to help PHP applications make use of the Microsoft AJAX Library. This is a shared source project under the Microsoft Permissive License, and I'd love your contributions!

Below a simple Hello World :

  1. // HelloService.php:
  2. require_once '../../dist/MSAjaxService.php';

  3. class HelloService extends MSAjaxService
  4. {
  5. function SayHello($name)
  6. {
  7. return "Hello, " . $name . "!";
  8. }
  9. }

  10. $h = new HelloService();
  11. $h->ProcessRequest();
And the index.html page :