Using WCF Services with PHP
I conducted my first experiment with PHP. PHP is widely used in the world of the Web and in all likelihood there will dawn a day when DT is asked just for such an integration. As PHP4 development and support is soon going to be discontinued, I didn't bother with an example using PHP4 SOAP tools. PHP5 is on 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 have Apache and PHP5 running on Windows and for SOAP support I have 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 will present a PHP code calling the service's Add() method and writing the result on the screen. An example of WCF code can be found in our 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 be something like this:
WCF Test 2.5 + 3.5 = 6
As you can see, using WCF services in PHP is very simple. The SOAP library provided along with PHP5 does a great deal of the work "behind the curtains", leaving us with an easily readable brief code.
上一篇: ms sql删除重复的记录
推荐阅读
-
IIS7 配置大全(ASP.NET 2.0, WCF, ASP.NET MVC,php)
-
利用PHP SOAP扩展实现简单Web Services
-
PHP7.27: connect mysql 5.7 using new mysqli_connect
-
php 权限管理 Permissions Using Bitwise
-
改写百度云推送SDK,PHP PEAR 包:Services_Baidu_Push
-
为Apple Push开发的PHP PEAR 包:Services_Apple_PushNotification
-
钱币换算 Currency conversion using php and Google calculator api
-
Using PHP with mod_fcgid
-
求大神帮忙,php如何从WCF服务取数据
-
利用PHP SOAP扩展实现简单Web Services,soapservices