-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.php
30 lines (20 loc) · 1.17 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use GoetasWebservices\SoapServices\SoapClient\ClientFactory;
use GoetasWebservices\SoapServices\SoapClient\Builder\SoapContainerBuilder;
use GoetasWebservices\Client\UPSShipService\SoapContainer;
use GoetasWebservices\Client\UPSShipService\SoapStubs\ShipService;
require __DIR__ . '/vendor/autoload.php';
// project initialization
$container = new SoapContainer();
// use this when cloning this repository and keeping the directory, comment it when including goetas-webservices/ups-ship-client via composer
$serializer = SoapContainerBuilder::createSerializerBuilderFromContainer($container)->build();
// uncomment this when including goetas-webservices/ups-ship-client via composer
// $serializer = SoapContainerBuilder::createSerializerBuilderFromContainer($container, null, __DIR__ . '/vendor/goetas-webservices/ups-ship-client')->build();
$metadata = $container->get('goetas_webservices.soap_client.metadata_reader');
$factory = new ClientFactory($metadata, $serializer);
/**
* @var $client ShipService
*/
$client = $factory->getClient('SCHEMA-WSDLs/Ship.wsdl','ShipPort', 'ShipService');
$result = $client->ProcessShipment(/* put here your params */);
var_dump($result);