-
Notifications
You must be signed in to change notification settings - Fork 2
/
sample-merlion.php
204 lines (199 loc) · 9.31 KB
/
sample-merlion.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<?php
/**
* Test with Merlion for 'https://api.merlion.com/dl/mlservice3?wsdl'
* @package Merlion
* @author WsdlToPhp Team <[email protected]>
* @version 20150429-01
* @date 2016-12-29
*/
ini_set('memory_limit','512M');
ini_set('display_errors',true);
error_reporting(-1);
/**
* Load autoload
*/
require_once dirname(__FILE__) . '/MerlionAutoload.php';
/**
* Wsdl instanciation infos. By default, nothing has to be set.
* If you wish to override the SoapClient's options, please refer to the sample below.
*
* This is an associative array as:
* - the key must be a MerlionWsdlClass constant beginning with WSDL_
* - the value must be the corresponding key value
* Each option matches the {@link http://www.php.net/manual/en/soapclient.soapclient.php} options
*
* Here is below an example of how you can set the array:
* $wsdl = array();
* $wsdl[MerlionWsdlClass::WSDL_URL] = 'https://api.merlion.com/dl/mlservice3?wsdl';
* $wsdl[MerlionWsdlClass::WSDL_CACHE_WSDL] = WSDL_CACHE_NONE;
* $wsdl[MerlionWsdlClass::WSDL_TRACE] = true;
* $wsdl[MerlionWsdlClass::WSDL_LOGIN] = 'myLogin';
* $wsdl[MerlionWsdlClass::WSDL_PASSWD] = '**********';
* etc....
* Then instantiate the Service class as:
* - $wsdlObject = new MerlionWsdlClass($wsdl);
*/
/**
* Examples
*/
/*********************************
* Example for MerlionServiceHello
*/
$merlionServiceHello = new MerlionServiceHello();
// sample call for MerlionServiceHello::helloWorld()
if($merlionServiceHello->helloWorld(new MerlionStructHelloWorld(/*** update parameters list ***/)))
print_r($merlionServiceHello->getResult());
else
print_r($merlionServiceHello->getLastError());
/*******************************
* Example for MerlionServiceGet
*/
$merlionServiceGet = new MerlionServiceGet();
// sample call for MerlionServiceGet::getCatalog()
if($merlionServiceGet->getCatalog(new MerlionStructGetCatalog(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getShipmentDates()
if($merlionServiceGet->getShipmentDates(new MerlionStructGetShipmentDates(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getShipmentMethods()
if($merlionServiceGet->getShipmentMethods(new MerlionStructGetShipmentMethods(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getShipmentAgents()
if($merlionServiceGet->getShipmentAgents(new MerlionStructGetShipmentAgents(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getCounterAgent()
if($merlionServiceGet->getCounterAgent(new MerlionStructGetCounterAgent(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getRepresentative()
if($merlionServiceGet->getRepresentative(new MerlionStructGetRepresentative(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getEndPointDelivery()
if($merlionServiceGet->getEndPointDelivery(new MerlionStructGetEndPointDelivery(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getPackingTypes()
if($merlionServiceGet->getPackingTypes(new MerlionStructGetPackingTypes(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getItems()
if($merlionServiceGet->getItems(new MerlionStructGetItems(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getItemsAvail()
if($merlionServiceGet->getItemsAvail(new MerlionStructGetItemsAvail(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getItemsProperties()
if($merlionServiceGet->getItemsProperties(new MerlionStructGetItemsProperties(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getItemsImages()
if($merlionServiceGet->getItemsImages(new MerlionStructGetItemsImages(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getItemsBarcodes()
if($merlionServiceGet->getItemsBarcodes(new MerlionStructGetItemsBarcodes(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getLinkedItems()
if($merlionServiceGet->getLinkedItems(new MerlionStructGetLinkedItems(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getOrdersList()
if($merlionServiceGet->getOrdersList(new MerlionStructGetOrdersList(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getOrderLines()
if($merlionServiceGet->getOrderLines(new MerlionStructGetOrderLines(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getOrderLinesGTD()
if($merlionServiceGet->getOrderLinesGTD(new MerlionStructGetOrderLinesGTD(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getCommandResult()
if($merlionServiceGet->getCommandResult(new MerlionStructGetCommandResult(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getCurrencyRate()
if($merlionServiceGet->getCurrencyRate(new MerlionStructGetCurrencyRate(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
// sample call for MerlionServiceGet::getCountry()
if($merlionServiceGet->getCountry(new MerlionStructGetCountry(/*** update parameters list ***/)))
print_r($merlionServiceGet->getResult());
else
print_r($merlionServiceGet->getLastError());
/*******************************
* Example for MerlionServiceSet
*/
$merlionServiceSet = new MerlionServiceSet();
// sample call for MerlionServiceSet::setLinkedItems()
if($merlionServiceSet->setLinkedItems(new MerlionStructSetLinkedItems(/*** update parameters list ***/)))
print_r($merlionServiceSet->getResult());
else
print_r($merlionServiceSet->getLastError());
// sample call for MerlionServiceSet::setOrderHeaderCommand()
if($merlionServiceSet->setOrderHeaderCommand(new MerlionStructSetOrderHeaderCommand(/*** update parameters list ***/)))
print_r($merlionServiceSet->getResult());
else
print_r($merlionServiceSet->getLastError());
// sample call for MerlionServiceSet::setOrderLineCommand()
if($merlionServiceSet->setOrderLineCommand(new MerlionStructSetOrderLineCommand(/*** update parameters list ***/)))
print_r($merlionServiceSet->getResult());
else
print_r($merlionServiceSet->getLastError());
// sample call for MerlionServiceSet::setAddOrderLineCommand()
if($merlionServiceSet->setAddOrderLineCommand(new MerlionStructSetAddOrderLineCommand(/*** update parameters list ***/)))
print_r($merlionServiceSet->getResult());
else
print_r($merlionServiceSet->getLastError());
// sample call for MerlionServiceSet::setMoveOrderLineCommand()
if($merlionServiceSet->setMoveOrderLineCommand(new MerlionStructSetMoveOrderLineCommand(/*** update parameters list ***/)))
print_r($merlionServiceSet->getResult());
else
print_r($merlionServiceSet->getLastError());
// sample call for MerlionServiceSet::setDeleteOrderCommand()
if($merlionServiceSet->setDeleteOrderCommand(new MerlionStructSetDeleteOrderCommand(/*** update parameters list ***/)))
print_r($merlionServiceSet->getResult());
else
print_r($merlionServiceSet->getLastError());
// sample call for MerlionServiceSet::setSignOrderCommand()
if($merlionServiceSet->setSignOrderCommand(new MerlionStructSetSignOrderCommand(/*** update parameters list ***/)))
print_r($merlionServiceSet->getResult());
else
print_r($merlionServiceSet->getLastError());
/*********************************
* Example for MerlionServiceUnset
*/
$merlionServiceUnset = new MerlionServiceUnset();
// sample call for MerlionServiceUnset::unsetSignOrderCommand()
if($merlionServiceUnset->unsetSignOrderCommand(new MerlionStructUnsetSignOrderCommand(/*** update parameters list ***/)))
print_r($merlionServiceUnset->getResult());
else
print_r($merlionServiceUnset->getLastError());