wangwengwu 发表于 2017-3-26 12:46:56

PHP与JAVA通信之 SOAP

首先开启php.ini里的 extension=php_soap.dll

把php_soap.dll复制到windows去

php的简单代码
<?php
$wsdl = "http://localhost:8080/axis2/services/CalculateService?wsdl";

//set up webservice client
$client = new SoapClient($wsdl);

//set up parameter
$parms = array("x"=>1,"y"=>2);

//call the plus method
$response = $client->plus($parms);

echo $response->return;
?>

简单说明:
1.首先建立webservice访问对象
2.设置参数x和y的值
3.访问plus方法,计算x与y的和
4.输出返回结果
页: [1]
查看完整版本: PHP与JAVA通信之 SOAP