lawiet/nusoap
Composer 安装命令:
composer require lawiet/nusoap
包简介
NuSOAP PHP library
README 文档
README
Fork of NuSOAP fixed for PHP 5.4+ and 7.x
Work in namespace (maintenance)
All credits belongs to official author(s): http://nusoap.sourceforge.net.
Install
composer require lawiet/nusoap
Usage Client
// Config $client = new NuSoapClient('http://localhost/nusoap/server.php?wsdl', 'wsdl'); $client->soap_defencoding = 'UTF-8'; $client->decode_utf8 = FALSE; $error = $client->getError(); // Calls $result = $client->call($action, $data); if ($client->fault) { echo "<h2>Fault</h2><pre>"; print_r($result); echo "</pre>"; } else { $error = $client->getError(); if ($error) { echo "<h2>Error</h2><pre>" . $error . "</pre>"; } else { echo "<h2>Main</h2>"; echo $result; } }
Usage Server
// Create the server instance $server = new NuSoapServer(); $server->configureWSDL('server', 'urn:server'); $server->wsdl->schemaTargetNamespace = 'urn:server'; //SOAP complex type return type (an array/struct) $server->wsdl->addComplexType( 'Person', 'complexType', 'struct', 'all', '', array( 'id_user' => array('name' => 'id_user', 'type' => 'xsd:int'), 'fullname' => array('name' => 'fullname', 'type' => 'xsd:string'), 'email' => array('name' => 'email', 'type' => 'xsd:string'), 'level' => array('name' => 'level', 'type' => 'xsd:int') ) ); //first simple function $server->register('hello', array('username' => 'xsd:string'), //parameter array('return' => 'xsd:string'), //output 'urn:server', //namespace 'urn:server#helloServer', //soapaction 'rpc', // style 'encoded', // use 'Just say hello'); //description //this is the second webservice entry point/function $server->register('login', array('username' => 'xsd:string', 'password'=>'xsd:string'), //parameters array('return' => 'tns:Person'), //output 'urn:server', //namespace 'urn:server#loginServer', //soapaction 'rpc', // style 'encoded', // use 'Check user login'); //description //first function implementation function hello($username) { return 'Howdy, '.$username.'!'; } //second function implementation function login($username, $password) { //should do some database query here // .... ..... ..... ..... //just some dummy result return array( 'id_user'=>1, 'fullname'=>'John Reese', 'email'=>'john@reese.com', 'level'=>99 ); } $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ''; $server->service($HTTP_RAW_POST_DATA);
lawiet/nusoap 适用场景与选型建议
lawiet/nusoap 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18.01k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2017 年 09 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「soap」 「webservices」 「web services」 「wsdl」 「ws」 「nusoap」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lawiet/nusoap 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lawiet/nusoap 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lawiet/nusoap 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
cURL and cURL based Soap-Client for PHP
A PHP client for the Salesforce SOAP API
Kinikit - PHP Application development framework
A collection of server-side addons that might be of use for development of xml-rpc (and json-rpc) based applications
Kinikit - PHP Application development framework MVC component
Model of a web-based resource
统计信息
- 总下载量: 18.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPLv2
- 更新时间: 2017-09-06