顶!~
正在看php的源代码,仍然未找到办法。。
请熟悉的大侠给指条明路
正在看php的源代码,仍然未找到办法。。
请熟悉的大侠给指条明路
解决方案 »
- 请教高手, php的用户登录
- 如何保持地址栏地址内容不变,而实际的URL已经改变
- 怎么取出mysql数据表中最大的十个数?
- 做个调查,大家都看过什么书(来者有分)
- 一个正则表达式问题
- phplib template 模板记录该如何显示~
- 一搜的这个mp3搜索是怎么编码的呀
- 怪问题??新开窗口后,sessin失效!!
- $query="select * from table where name='$_SESSION["name"]'";$_SESSION["name"]中的双引号该怎么打才不会报错??
- 复制网站文本后,跳转打开微信客户端 这个是怎么实现的
- 文件夹选择和文件处理问题
- 表单传递过来的问题,请教大家!
呵呵,我去试试先Soap is a protocol that requires two parts to be involved. First one is close-end server that runs requests on the far-end server and shows results to the client.
NuSoap library can run on either or on both of them. If you want to run NuSoap server on the far-end server (SOAP server) you'd create a php file and use it in your WSDL URL.
For example, suppose you have a php function on far-end server and you want it to be run via SOAP protocol:Code: <?php
require_once('nusoap.php');
$server = new soap_server;
$server->configureWSDL('Test','http://soapinterop.org/');
$server->wsdl->schemaTargetNamespace = 'http://soapinterop.org/xsd/';
$server->register(
'hello',
array('name'=>'xsd:string'),
array('return'=>'xsd:string'),
'http://soapinterop.org/'); function hello($name){
return "Hello $name!";
} $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ?
$HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
You see that this you have to define input and output parameters for your function and register it with instance of soap_server class. This way you can register as many functions as you wish.
All of them can be invoked by any SOAP-compatible clients, not only NuSoap.
Target WSDL document is generated using data registered in $server->register() method call. Suppose you placed test.php file shown above in the root of you web. It means that the target WSDL URL should be
http://yourserver/test.php?wsdl
If you run this link without wsdl argument you'll see a short description in HTML form. Now few hints about close-end server (SOAP client). It can run a given method on a given SOAP server using WSDL URL.
For example with the far-end server sample shown above it can be done using the following way:Code: <?php
require_once('nusoap.php');
$arg = "test message";
$wsdl = "http://yourserver/test.php?wsdl";
$soap = new soapclient($wsdl,"wsdl");
$proxy = $soap->getProxy();
$result = $proxy->hello($arg);
?>
Now about NuSoap wizard. It can generate a code sample shown above to be run on SOAP client side (close-end server). First it ask if you know a particular WSDL URL or want to select one from the public domain (service). Once WSDL URL is given you are able to select an operation (hello function in our case). Once operation is selected you can see all necessary arguments for it and you can type values that the call should be generated with.