<?php
include_once 'vendor/autoload.php';
use Sumatra\SumatraClientFactory;
use Sumatra\Type\Kunden_einwilligung_argument;
$wsdl = 'http://example.com/sumatra.wsdl';
$username = 'username';
$password = 'password';
$options = []; // @see http://php.net/manual/en/soapclient.soapclient.php#refsect1-soapclient.soapclient-parameters
$client = SumatraClientFactory::factory(
$wsdl,
$username,
$password,
$options
);
$argument = (new Kunden_einwilligung_argument())
->withBegruendung('John Snow')
->withAnrede('Herr')
->withNewsletter(true)
->withZuname('Albrecht')
->withEmail('test@example.com');
try {
$response = $client->kunden_einwilligung($argument);
echo $response->getStatus()->getInformation();
} catch (Exception $exception) {
echo $exception->getMessage();
}