PHPackages                             notifius/php-wctp - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. notifius/php-wctp

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

notifius/php-wctp
=================

A PHP library for creating and handling XML request/response objects for the WCTP v1.3r1 specification.

v1.0.2(4mo ago)2485MITPHPPHP ^7.3|^8.0CI failing

Since Sep 1Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/NotifiUs/php-wctp)[ Packagist](https://packagist.org/packages/notifius/php-wctp)[ Docs](https://github.com/notifius/php-wctp)[ RSS](/packages/notifius-php-wctp/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (3)Versions (14)Used By (0)

php-wctp
========

[](#php-wctp)

A PHP library for creating and submitting XML WCTP requests and responses.

Getting Started
---------------

[](#getting-started)

Add the library to your project using [composer](https://getcomposer.org):

```
composer require notifius/php-wctp
```

Example usage:

```
use NotifiUs\WCTP\XML\ClientQuery;

$clientQuery = new ClientQuery();

$xml = $clientQuery
    ->senderID( 'senderID' )
    ->recipientID( 'recipientID' )
    ->trackingNumber( 'trackingNumber' )
    ->xml();
```

XML Request Method Templating
-----------------------------

[](#xml-request-method-templating)

WCTP Methodnotifius/wctpStatuswctp-ClientQueryNotifiUs\\WCTP\\XML\\ClientQuery✓wctp-LookupSubscriberNotifiUs\\WCTP\\XML\\LookupSubscriber✓wctp-DeviceLocationNotifiUs\\WCTP\\XML\\DeviceLocation✓wctp-MessageReplyNotifiUs\\WCTP\\XML\\MessageReply✓wctp-PollForMessagesNotifiUs\\WCTP\\XML\\PollForMessages×wctp-ReturnToSvcNotifiUs\\WCTP\\XML\\ReturnToSvc✓wctp-SendMsgMultiNotifiUs\\WCTP\\XML\\SendMsgMulti×wctp-StatusInfoNotifiUs\\WCTP\\XML\\StatusInfo×wctp-SubmitClientMessageNotifiUs\\WCTP\\XML\\SubmitClientMessage✓wctp-SubmitRequestNotifiUs\\WCTP\\XML\\SubmitRequest✓wctp-VersionQueryNotifiUs\\WCTP\\XML\\VersionQuery✓Return Type
-----------

[](#return-type)

The `$xml` variable will be a *SimpleXMLElement* Object. You can get the XML as a string by calling `$xml->asXML()`

Relaxed parameter requirements
------------------------------

[](#relaxed-parameter-requirements)

While we follow the WCTP recommendations for parameters and lengths, we don't enforce allowed characters. Anything that is not XML compliant will be automatically escaped, so keep that in mind. This should provide an additional level of flexibility (through conventions) and modernize the now ~15 year-old protocol.

Add WCTP token to wctp-Operation
--------------------------------

[](#add-wctp-token-to-wctp-operation)

For all XML WCTP methods below, you can optionally pass in a `wctpToken` to the constructor:

```
$clientQuery = new ClientQuery( 'token' );
```

This will add the XML attribute `wctpToken="token"` to the `` element.

WCTP XML Methods
----------------

[](#wctp-xml-methods)

### wctp-MessageReply

[](#wctp-messagereply)

Create an XML representation of the wctp-MessageReply operation.

```
use Carbon\Carbon;
use NotifiUs\WCTP\XML\MessageReply;

$messageReply = new MessageReply();

$xml = $messageReply
    ->messageID( 321 )
    ->senderID( 'senderID' )
    ->recipientID( 'recipientID' )
    ->responseToMessageID( 123 )
    ->submitTimestamp( Carbon::now() )
    ->payload( 'Reply to a message' )
    ->xml();

print_r( $xml );
```

### wctp-ClientQuery

[](#wctp-clientquery)

Create an XML representation of the wctp-ClientQuery operation.

```
use NotifiUs\WCTP\XML\ClientQuery;

$clientQuery = new ClientQuery();

$xml = $clientQuery
    ->senderID( 'senderID' )
    ->recipientID( 'recipientID' )
    ->trackingNumber( 'trackingNumber' )
    ->xml();

print_r( $xml );

/*
SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [wctpVersion] => WCTP-DTD-V1R3
        )

    [wctp-ClientQuery] => SimpleXMLElement Object
        (
            [@attributes] => Array
                (
                    [senderID] => senderID
                    [recipientID] => recipientID
                    [trackingNumber] => trackingNumber
                )

        )

)
*/
```

### wctp-VersionQuery

[](#wctp-versionquery)

Create an XML representation of the wctp-VersionQuery operation.

```
use NotifiUs\WCTP\XML\VersionQuery;

$versionQuery = new VersionQuery();
$xml = $versionQuery
    ->inquirer( 'inquirer' )
    ->dateTime( Carbon::now() )
    ->xml();
```

You can also leave off optional parameters like this:

```
//dateTime is an optional parameter
$xml = $versionQuery
    ->inquirer( 'inquirer' )
    ->xml();
```

License
-------

[](#license)

The php-wctp library is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

Testing
-------

[](#testing)

After cloning the repository and running `composer install`, you can run the test suite:

```
vendor/bin/phpunit
```

### Static Analysis

[](#static-analysis)

Run PHPStan to check for type and logic errors:

```
vendor/bin/phpstan analyse
```

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability, please email .

All security vulnerabilities will be promptly addressed.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance77

Regular maintenance activity

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 51.1% 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 ~196 days

Recently: every ~45 days

Total

13

Last Release

127d ago

Major Versions

v0.2.1 → v1.0.02026-02-16

PHP version history (3 changes)v0.0.1PHP ^7.3

v0.0.5PHP ^7.3|^8.0

v0.2.0PHP ^7.3|^8.0|^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1407028?v=4)[Patrick Labbett](/maintainers/plabbett)[@plabbett](https://github.com/plabbett)

---

Top Contributors

[![CmsGithub](https://avatars.githubusercontent.com/u/104215674?v=4)](https://github.com/CmsGithub "CmsGithub (23 commits)")[![plabbett](https://avatars.githubusercontent.com/u/1407028?v=4)](https://github.com/plabbett "plabbett (22 commits)")

---

Tags

phpwctpphpxmlwctp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/notifius-php-wctp/health.svg)

```
[![Health](https://phpackages.com/badges/notifius-php-wctp/health.svg)](https://phpackages.com/packages/notifius-php-wctp)
```

###  Alternatives

[m1/vars

Vars is a simple to use and easily extendable configuration loader with in built loaders for ini, json, PHP, toml, XML and yaml/yml file types. It also comes with in built support for Silex and more frameworks to come soon.

64124.3k1](/packages/m1-vars)[goetas/xsd2php-runtime

Convert XSD (XML Schema) definitions into PHP classes

493.3k](/packages/goetas-xsd2php-runtime)[bupy7/xml-constructor

The array-like constructor of XML document structure.

1338.9k](/packages/bupy7-xml-constructor)

PHPackages © 2026

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