I recently wrote and postings on the subject of WCF SERVICES:WCF services? Let ' s Get Started and WCF and Unit Tests. One could see that creating and testing services is not complicated on all. Let's go on and take some steps nearer to the real world? Our service was used by SOAP clients running on different platforms.
I conducted my first experiment with PHP. PHP is widely used in the world of the Web with all likelihood there would dawn a day when DT are asked just for such an I Ntegration. As PHP4 development and support are soon going to being discontinued, I didn ' t bother with an example using PHP4 SOAP tools. PHP5 is in the market and it comes with a quick and stable SOAP library. The performance is many times better than in case of similar widgets written for PHP4.
I had Apache and PHP5 running on Windows and for SOAP support I had to use an extension named Php_soap.dll. Thus, I have to remove the comment mark in front of the appropriate php.ini line and restart Apache.
As an example I'll present a PHP code calling the service ' s Add () method and writing the result on the screen. An example of WCF code can being found in we blog, in the posting WCF Services? Let ' s Get Started.
x = 2.5; $obj->y = 3.5; $retval = $client->add ($obj); echo "2.5 + 3.5 =". $retval->addresult;? >
If Nothing went wrong, the result should is something like this:
WCF Test 2.5 + 3.5 = 6
As can see, the using WCF services in PHP are very simple. The SOAP library provided along with PHP5 does a great deal of the work "behind the curtains", leaving us with an easily r Eadable Brief code.