PHPackages                             xjtuana/xjtu-webservice - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. xjtuana/xjtu-webservice

ActiveLibrary[API Development](/categories/api)

xjtuana/xjtu-webservice
=======================

XJTU Webservice package for PHP

v1.1.1(8y ago)01081MITPHP

Since Aug 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/xjtuana/xjtu-webservice-php)[ Packagist](https://packagist.org/packages/xjtuana/xjtu-webservice)[ RSS](/packages/xjtuana-xjtu-webservice/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (5)Used By (1)

XJTU Webservice - PHP Version
=============================

[](#xjtu-webservice---php-version)

PHP Client for XJTU Webservice

目前支持：

- WsUserInfo 用户信息接口
- WsUserPhoto 用户照片接口
- WsSms 短信平台接口

Usage 使用方法
----------

[](#usage-使用方法)

- 通过Composer引入包（[Packagist](https://packagist.org/packages/xjtuana/xjtu-webservice)）

```
composer require xjtuana/xjtu-webservice ~1.0
```

- 示例代码

```
use Xjtuana\XjtuWs\WebService\WsUserInfo;
use Xjtuana\XjtuWs\WebService\XjtuWebServiceException;

try {

    $userinfo = new WsUserInfo(
        // url of the webservice
        'url',
        // config of the webservice
        [
            'auth' => ...,
        ],
        // options for SoapClient (see: http://php.net/manual/en/soapclient.soapclient.php)
        [
            'compression ' => ....,
            'connection_timeout' => ...., // default connection_timeout = 5
            ...
        ]
    );

    $result = $userinfo->getByNetid('netid');

} catch(XjtuWebServiceException $e) {
    echo $e->getMessage();
} catch(\SoapFault $e) {
    throw $e;
}

var_dump($result);
```

API
---

[](#api)

### WsUserInfo

[](#wsuserinfo)

- `__construct()` 构造函数
    - 参数：`string` 调用URL
    - 参数：`array` 配置数组

```
[
    'auth' => 'WS_AUTH',
]
```

- `getByNetid()` 通过NETID获取信息

    - 参数：`string` 查询的NETID
    - 返回值：`array` 用户对象数组
- `getByName()` 通过姓名获取信息

    - 参数：`string` 查询的姓名
    - 返回值：`array` 用户对象数组
- `getByUserno()` 通过学工号获取信息

    - 参数：`string` 查询的学工号
    - 返回值：`array` 用户对象数组
- `getByMobile()` 通过手机号获取信息

    - 参数：`string` 查询的手机号
    - 返回值：`array` 用户对象数组
- `setFilter()` 设置要隐藏的字段

    - 参数：`array` 字段名数组
    - 返回值：`UserInfo` (可链式调用，对当前示例持续生效)
    - 示例：

    ```
    $userinfo->setFilter(['userno'])->getByNetid('netid');
    ```

    - 注意：默认`filter = ['idcardname' ,'idcardno']`，即默认隐藏证件名称和证件号码

#### 字段列表

[](#字段列表)

字段名含义示例userno学工号2100000000useridNetIDuser.netidusername姓名王二小gender性别男 / 女email邮箱usertype用户类型1(学生) / 2(教职工)classid班级6046dep所属部门/学院电子与信息工程学院depid部门/学院代码birthday生日2000-02-20idcardname证件名称身份证idcardno证件号码marriage婚姻状况未婚mobile手机号18222222222nation民族汉族nationplace故乡/生源地河北polity政治面貌无党派民主人士roomnumber宿舍东2宿舍-0222roomphone宿舍电话speciality专业名称计算机科学与技术studenttype学生类型统考本科生 / 统考硕士 / 博士tutoremployeeid导师姓名王树国### WsUserPhoto

[](#wsuserphoto)

- `__construct()` 构造函数
    - 参数：`string` 调用URL
    - 参数：`array` 配置数组

```
[
    'auth' => 'WS_AUTH',
]
```

- `getByUserno()` 通过学工号获取照片

    - 参数：`string` 查询的学工号
    - 返回值：`string` (base64)

### WsSms

[](#wssms)

- `__construct()` 构造函数
    - 参数：`string` 调用URL
    - 参数：`array` 配置数组

```
[
    'usr' => 'WS_USER',
    'pwd' => 'WS_PASSWORD',
]
```

- `send()` 发送短信

    - 参数1：`string` 目标手机号，多个号码用半角逗号隔开
    - 参数2: `string` 短信内容，根据长度会拆分成多条
    - 返回值：`int` 发送结果，好像没什么用，成不成功都回0

Related Packages 相关包
--------------------

[](#related-packages-相关包)

- [xjtuana/laravel-xjtuana](https://git.xjtuana.com/xjtuana/laravel-xjtuana)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~32 days

Total

4

Last Release

3082d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e8269d1d25a12e9e1e75f9fb84f588ed9eebccc95b64bc4781b884040cd0e646?d=identicon)[meteorlxy](/maintainers/meteorlxy)

![](https://www.gravatar.com/avatar/12754befff2f24133419ca34325785000ae4f076b663f2295a57d7b6826772a1?d=identicon)[BochengZou](/maintainers/BochengZou)

---

Top Contributors

[![meteorlxy](https://avatars.githubusercontent.com/u/18205362?v=4)](https://github.com/meteorlxy "meteorlxy (11 commits)")

---

Tags

soapwebservicexjtu

### Embed Badge

![Health badge](/badges/xjtuana-xjtu-webservice/health.svg)

```
[![Health](https://phpackages.com/badges/xjtuana-xjtu-webservice/health.svg)](https://phpackages.com/packages/xjtuana-xjtu-webservice)
```

###  Alternatives

[laminas/laminas-soap

6121.8M37](/packages/laminas-laminas-soap)[gusapi/gusapi

Gus Api Library for PHP

1351.5M8](/packages/gusapi-gusapi)[codedredd/laravel-soap

A SoapClient wrapper integration for Laravel

221516.6k3](/packages/codedredd-laravel-soap)[afipsdk/afip.php

Libreria para usar los Web Services de AFIP (Argentina)

284121.2k5](/packages/afipsdk-afipphp)[besimple/soap-client

Build and consume SOAP Client based web services

582.2M14](/packages/besimple-soap-client)[camcima/camcima-soap-client

Wrapper around PHP SoapClient class

2672.0k2](/packages/camcima-camcima-soap-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
