Silverlight & PHP

Silverlight 2 Beta 2 enables significantly improved interop with SOAP based web-services. Web service proxy class end-point URLs can now be configured without recompiling applications. Visual Studio also now has a new “Silverlight-enabled WCF Service” project item template that you can add to ASP.NET web projects to publish services to clients.

It is uncommon to use Silverlight in conjunction with PHP, but sometimes you may need this. In this post I will show you how easy it can be using Silverlight SOAP based web-services support. Actually it is really very simple. All we need is a PHP web service. Than we just add a Service reference to our Silverlight app, and voila.

There are a few ways to create a PHP SOAP web service. In this example I will use NuSOAP library. The NuSOAP project is hosted by SourceForge. NuSOAP is a group of PHP classes that allow developers to create and consume SOAP web services. It does not require any special PHP extensions. The current release version (0.7.3) of NuSOAP supports SOAP 1.1 specification. It can generate WSDL 1.1 and also consume it for use in serialization. Both rpc/encoded and document/literal services are supported. Continue Reading…