Chinaunix首页 | 论坛 | 博客
  • 博客访问: 242666
  • 博文数量: 76
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 745
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-28 16:04
文章分类

全部博文(76)

文章存档

2013年(2)

2010年(21)

2009年(53)

我的朋友

分类:

2009-10-28 19:25:52

[CODE:]SoapClient.php

/** *******************************
 *  2008-09-24 SOAP Client Test.
 *  Author : Mervin.G
 *  Call me : 76969318
 *  V 1.0 
 * *********************************/

echo "start";
include(
'./lib/nusoap.php');

$type "我是一只小老虎";
$params2 = array('type'=>$type);

$client = new soapclient('');
$error $client->call('acceptData'$params2);

echo '

htmlspecialchars($client->debug_strENT_QUOTES) . '
';
//检测发送至服务端后返回来的数据

echo 
$error;
?>

[CODE:]SoapServer.php

/** *******************************
 *  2008-09-24 SOAP Server Test.
 *  Author : Mervin.G
 *  Call me : 76969318
 *  V 1.0 
 * *********************************/

require_once('./lib/nusoap.php');

$soap = new soap_server;
// Initialize WSDL support
$soap->configureWSDL('acceptDatawsdl''urn:acceptDatawsdl');
// Register the method to expose
$soap->register('acceptData',                // method name
    
array('type' => 'xsd:string'),        // input parameters
    
array('return' => 'xsd:string'),      // output parameters
    
'urn:acceptDatawsdl',                      // namespace
    
'urn:acceptDatawsdl#acceptData',                // soapaction
    
'rpc',                                // style
    
'encoded',                            // use
    
'soap service data'            // documentation
);
$soap->service($HTTP_RAW_POST_DATA);
function 
acceptData($type) {    
    return 
$type;
?>


返回结果:我是一只小老虎

文件:【Web Service】nusoap-0.7.3.zip
大小:171KB
下载:下载
文件:【Web Service】nusoap-docs-0.7.3.zip
大小:316KB
下载:下载
阅读(502) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~