oefenweb / cakephp-uni-login-webservice
CakePHP 的 UNI•Login (Web Service) 插件
v1.0.0
2019-01-23 12:29 UTC
Requires
- php: >=7.0.0
- ext-soap: *
- composer/installers: ~1.0
README
本插件与 UNI•Login webservice (WS-02) 进行通信。该 Web 服务提供 UNI•Login 用户的基本信息(按机构)。此服务不需要机构签署的协议。
需求
- CakePHP 2.9.0 或更高版本。
- PHP 7.0.0 或更高版本。
安装
将此目录中的文件克隆/复制到 app/Plugin/UniLoginWebservice
配置
确保在 app/Config/bootstrap.php 中通过调用
CakePlugin::load('UniLoginWebservice');
确保在 app/Config/bootstrap.php 中配置以下行
Configure::write('UniLoginWebservice.wsBrugerid', 'wsBrugerid');
Configure::write('UniLoginWebservice.wsPassword', 'wsPassword');
确保在 app/Config/database.php 中配置以下行
public $uniLoginWebservice = [
'datasource' => 'UniLoginWebservice.SoapSource',
'wsdl' => 'https://ws02.infotjeneste.uni-c.dk/infotjeneste-ws/ws?WSDL'
];
用法
使 UniLogin webservice 可用
public $uses = ['UniLoginWebservice.UniLogin'];
执行 "helloWorld" 调用
$this->UniLogin->helloWorld();
执行 "helloSOAPFaultDemo" 调用
$this->UniLogin->helloSOAPFaultDemo();
通过调用 "hentAnsatte" 获取员工数据
$employees = $this->UniLogin->getEmployees($instid);
通过调用 "hentAnsatte" 和为每个员工调用 "hentPerson" 获取员工的详细信息
$employees = $this->UniLogin->getEmployeesWithDetails($instid);
通过调用 "hentInstitution" 获取机构数据
$institution = $this->UniLogin->getInstitution($instid);
通过调用 "hentInstitutionsliste" 获取用户 "brugerid" 有关系的机构数据
$institutions = $this->UniLogin->getInstitutions($brugerid);
通过调用 "hentPerson" 获取个人数据
$person = $this->UniLogin->getPerson($brugerid);
通过调用 "hentAlleElever" 获取学生数据
$students = $this->UniLogin->getStudents($instid);
通过调用 "hentAlleElever" 和为每个学生调用 "hentPerson" 获取学生的详细信息
$students = $this->UniLogin->getStudentsWithDetails($instid);