PHP code example of goetas-webservices / euro-vies-client
1. Go to this page and download the library: Download goetas-webservices/euro-vies-client 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/ */
goetas-webservices / euro-vies-client example snippets
use GoetasWebservices\SoapServices\SoapClient\ClientFactory;
use GoetasWebservices\SoapServices\SoapClient\Builder\SoapContainerBuilder;
use GoetasWebservices\Client\EuroVies\SoapContainer;
use GoetasWebservices\Client\EuroVies\SoapStubs\CheckVatPortType;
rFromContainer($container)->build();
// uncomment this when including goetas-webservices/euro-vies-client via composer
// $serializer = SoapContainerBuilder::createSerializerBuilderFromContainer($container, null, __DIR__ . '/vendor/goetas-webservices/euro-vies-client')->build();
$metadata = $container->get('goetas_webservices.soap_client.metadata_reader');
$factory = new ClientFactory($metadata, $serializer);
/**
* @var $client CheckVatPortType
*/
$client = $factory->getClient('http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl','checkVatPort', 'checkVatService');
$result = $client->checkVat("DE", "123456789");
var_dump($result);