-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.php
executable file
·65 lines (52 loc) · 1.8 KB
/
client.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
<?php
$base_url = implode(array(
$_SERVER['REQUEST_SCHEME'] . '://',
$_SERVER['HTTP_HOST'],
dirname($_SERVER['REQUEST_URI']) . '/'
));
header("Content-Type: text/html; charset=utf-8");
header('Cache-Control: no-store, no-cache');
header('Expires: ' . date('r'));
ini_set('display_errors', 1);
error_reporting(E_ALL & ~E_NOTICE);
class IncomePlanRequest {
public $token;
}
class IncomeFactRequest {
public $token;
public $incomeFactList;
}
class IncomeFactList {
public $incomeFact;
}
class IncomeFact {
public $entry_id;
public $unit_id;
public $unit_title;
public $brand_id;
public $brand_title;
public $year;
public $month;
public $value;
public $comment;
}
ini_set("soap.wsdl_cache_enabled", "0"); // отключаем кеширование WSDL-файла для тестирования
$client = new SoapClient( $base_url . 'wsdl.php',
array( 'soap_version' => SOAP_1_2));
$incPlanReq = new IncomePlanRequest();
$incPlanReq->token = 'SomeTestToken';
var_dump($client->getIncomePlan($incPlanReq));
$incFactReq = new IncomeFactRequest();
$incFactReq->token = 'SomeTestToken';
$incFactReq->incomeFactList = new IncomeFactList();
$incFactReq->incomeFactList->incomeFact = new IncomeFact();
$incFactReq->incomeFactList->incomeFact->entry_id = 1;
$incFactReq->incomeFactList->incomeFact->unit_id = 100;
$incFactReq->incomeFactList->incomeFact->unit_title = "unit 1";
$incFactReq->incomeFactList->incomeFact->brand_id = 200;
$incFactReq->incomeFactList->incomeFact->brand_title = "brand 2";
$incFactReq->incomeFactList->incomeFact->year = 2015;
$incFactReq->incomeFactList->incomeFact->month = 10;
$incFactReq->incomeFactList->incomeFact->value = 1000;
$incFactReq->incomeFactList->incomeFact->comment = "comment 1";
var_dump($client->sendIncomeFact($incFactReq));