PHPackages                             raigu/x-road-soap-envelope - 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. raigu/x-road-soap-envelope

ActiveLibrary

raigu/x-road-soap-envelope
==========================

PHP library for creating a SOAP envelope for X-Road request.

v0.2.0(2mo ago)020MITPHPPHP ^7.2CI passing

Since May 19Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/raigu/x-road-soap-envelope)[ Packagist](https://packagist.org/packages/raigu/x-road-soap-envelope)[ RSS](/packages/raigu-x-road-soap-envelope/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (6)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/2eb3179708ab81be46c20794a6de28bda9979002af60eb0c663f07fc912aa8a7/68747470733a2f2f706f7365722e707567782e6f72672f72616967752f782d726f61642d736f61702d656e76656c6f70652f762f737461626c65)](https://packagist.org/packages/raigu/x-road-soap-envelope)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![Build Status](https://camo.githubusercontent.com/c679a0bc57ea8577635f1420a6d7d59632d50a62da9935fe6e66a20035cb5771/68747470733a2f2f7472617669732d63692e636f6d2f72616967752f782d726f61642d736f61702d656e76656c6f70652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/raigu/x-road-soap-envelope)[![codecov](https://camo.githubusercontent.com/7508a9519095b0ea56c367a7d5584788fb2a4d36bee12ed09c704171ba3e54b6/68747470733a2f2f636f6465636f762e696f2f67682f72616967752f782d726f61642d736f61702d656e76656c6f70652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/raigu/x-road-soap-envelope)[![Maintainability](https://camo.githubusercontent.com/55ba629e794ddf11ed65f2a3baf27ec4e67956650dbac9ad74485be84ca8c70e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66376537373063326161656332303539363938662f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/raigu/x-road-soap-envelope/maintainability)[![Scrutinizer](https://camo.githubusercontent.com/bcd3626b11745a9c86c8fd1145678664b45cb80eb01409add6c01c108a2766d8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72616967752f782d726f61642d736f61702d656e76656c6f70652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/raigu/x-road-soap-envelope/)

x-road-soap-envelope
====================

[](#x-road-soap-envelope)

PHP library for creating a SOAP envelope for X-Road request.

Intended for applications which proxy several X-Road services and must create SOAP requests dynamically. If you need to integrate only one X-Road service then this library might not be the best choice.

Requirements
============

[](#requirements)

- php 7.2+
- DOM extension

Installation
============

[](#installation)

```
$ composer require raigu/x-road-soap-envelope
```

Usage
=====

[](#usage)

```
require_once 'vendor/autoload.php';

use Raigu\XRoad\SoapEnvelope\SoapEnvelope;
use Raigu\XRoad\SoapEnvelope\Client;
use Raigu\XRoad\SoapEnvelope\ClientReference;
use Raigu\XRoad\SoapEnvelope\Service;
use Raigu\XRoad\SoapEnvelope\ServiceReference;
use Raigu\XRoad\SoapEnvelope\ServiceRequest;
use Raigu\XRoad\SoapEnvelope\UniqueId;

$envelope = new SoapEnvelope(
    new Client(
        new ClientReference('EE/GOV/MEMBER1/SUBSYSTEM1')
    ),
    new Service(
        new ServiceReference('EE/GOV/MEMBER2/SUBSYSTEM2/exampleService/v1')
    ),
    new ServiceRequest(
        '' .
        'foo' .
        ''
    ),
    new UniqueId
);

echo $envelope->asStr();
```

The above will output:

```

            EE
            GOV
            MEMBER1
            SUBSYSTEM1

            EE
            GOV
            MEMBER2
            SUBSYSTEM2
            exampleService
            v1

        0113072ef17ebb989e61a5b6c95f9efe
        4.0

            foo

```

The order of input parameters in `SoapEnvelope` constructor is not important.

There are more parameter types. See [future test](tests/Feature/XRoadRequestMessageCreationTest.php), it demonstrates all options.

Development
===========

[](#development)

```
$ git@github.com:raigu/x-road-soap-envelope.git
$ cd x-road-soap-envelope
$ composer install
```

Now you can run tests.

Testing
=======

[](#testing)

```
$ composer test
```

Human readable tests

```
$ composer test -- --testdox
```

Code coverage report

```
$ composer coverage
```

Motivation
==========

[](#motivation)

This library has grown out from [raigu/x-road-soap-envelope-builder](https://github.com/raigu/x-road-soap-envelope-builder)in pursuit of improving code metrics. In the process studied several code metrics service providers ( some more badges [![CodeScene Code Health](https://camo.githubusercontent.com/0e41350f02ecbf3197629968551e6c459caed7cadc27b9718c0db83af90efab0/68747470733a2f2f636f64657363656e652e696f2f70726f6a656374732f383231392f7374617475732d6261646765732f636f64652d6865616c7468)](https://codescene.io/projects/8219)[![CodeScene System Mastery](https://camo.githubusercontent.com/c023e6184b27c5b37eec48e5c5e1041f4fb84e856787318f8d52c49967af1c34/68747470733a2f2f636f64657363656e652e696f2f70726f6a656374732f383231392f7374617475732d6261646765732f73797374656d2d6d617374657279)](https://codescene.io/projects/8219)[![Test Coverage](https://camo.githubusercontent.com/54eba8cdeeb380b6304fd525e7120004a95210877034714ae37d0ee9e67efca7/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66376537373063326161656332303539363938662f746573745f636f766572616765)](https://codeclimate.com/github/raigu/x-road-soap-envelope/test_coverage))

One lesson I learned worth of sharing is that be suspicious about Maintainability Index. I tend to agree with the statement "*size as a measure of maintainability has been underrated, and that the “sophisticated” maintenance metrics are overrated*" referred in this [article](https://avandeursen.com/2014/08/29/think-twice-before-using-the-maintainability-index/).

References
==========

[](#references)

- [X-Road Terms and Abbreviations](https://www.x-tee.ee/docs/live/xroad/terms_x-road_docs.html)
- [X-Road: Message Protocol v4.0](https://www.x-tee.ee/docs/live/xroad/pr-mess_x-road_message_protocol.html#e1-request)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance83

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.3% 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 ~2100 days

Total

2

Last Release

85d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/82bf3ac844b3984ae4f9965188829da1729ca1e86abd92151406d15896c021b9?d=identicon)[raigu](/maintainers/raigu)

---

Top Contributors

[![raigu](https://avatars.githubusercontent.com/u/3442567?v=4)](https://github.com/raigu "raigu (170 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/raigu-x-road-soap-envelope/health.svg)

```
[![Health](https://phpackages.com/badges/raigu-x-road-soap-envelope/health.svg)](https://phpackages.com/packages/raigu-x-road-soap-envelope)
```

PHPackages © 2026

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