参考:http://blog.sina.com.cn/s/blog_777f9dbb01010fd1.html
配置
windows php.ini配置:extension = php_soap.dll
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
extension = "soap.so"
并把soap.so放到/usr/local/lib/php/extensions/no-debug-non-zts-20060613目录下
php支持soap参考: http://blog.youkuaiyun.com/bytxl/article/details/9284123
示例-WSDL模式:
ini_set( 'default_socket_timeout', 7 ); // timeout
ini_set("soap.wsdl_cache_enabled", "0"); // no cache
示例-非WSDL模式:
ini_set( 'default_socket_timeout', 7 ); // timeout
ini_set("soap.wsdl_cache_enabled", "0"); // no cache
手册上有人对上面加粗部分代码(函数参数)的注释
注释1:
If your service is a .NET doc/lit, which means the input message has a single part named 'parameters' that is a structure that wraps the parameters. Your call should look like this:
<?php
$params = array('param_name_1'=>$val_1,'param_name_2'=>$val_2);
$client->call('MethodName', array('parameters'=>$params));
?>
注释2:
Note that calling __soapCall and calling the generated method from WSDL requires specifying parameters in two different ways.
For example, if you have a web service with method login that takes username and password, you can call it the following way:
<?php
$params= array('username'=>'name','password'=>'secret');
$client->login($params);
?>
If you want to call __soapCall, you must wrap the arguments in another array as follows:
<?php
$client->__soapCall('login', array($params));
?>