PHP code example of raigu / x-road-soap-envelope

1. Go to this page and download the library: Download raigu/x-road-soap-envelope library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

raigu / x-road-soap-envelope example snippets




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(
        '<ns1:exampleService xmlns:ns1="http://producer.x-road.eu">' .
        '<exampleInput>foo</exampleInput>' .
        '</ns1:exampleService>'
    ),
    new UniqueId
);


echo $envelope->asStr();