Помогите с отправкой и получение данных по SOAP, второй день гугль юзаю так и нечего ненашёл подходящего.
Суть следуйщия:
Как я понял пример работы на php
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
| Методы¶
/**
* Authenticate user
* @param string $login : username
* @param string $domain : domain
* @param string $passwd : password
* @return integer : operation result
*/
public function authenticate($login,$domain,$passwd)
Возвращаемые значения¶
* 1 - авторизация успешна
* 0 - доступ заблокирован
* -1 - логин либо пароль не верны
Пример кода (PHP)
$wsdl = 'http://lanaccess.skynet.ua/service/wsdl/common';
$soap = new SoapClient($wsdl);
if(!$soap) { return(ERR_TEMP_FAILURE); }
$ip = $_SERVER['REMOTE_ADDR'];
// Определяем login и domain пользователя
if(strstr($uname,'@')) {
list($login,$domain) = explode('@',$uname); // полный логин login@domain
} else {
// 10.0.0.0/8
if(preg_match('/^10\./',$ip)) {
$login = $uname;
$domain = 'skynet.ua';
}
// 192.0.0.0/8
if(preg_match('/^192\./',$ip)) {
$login = $uname;
$domain = 'ostrov.net.ua';
}
}
$result = $soap->authenticate($login,$domain,$username['password']);
// И делаем с результатом что хотим |
|
XML |
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
| WSDL-документ
<wsdl:definitions targetNamespace="http://schema.example.com">
<wsdl:types>
<xsd:schema targetNamespace="http://schema.example.com"/>
</wsdl:types>
<message name="authenticateRequest">
<part name="login" type="xsd:string"/>
<part name="domain" type="xsd:string"/>
<part name="passwd" type="xsd:string"/>
</message>
<message name="authenticateResponse">
<part name="authenticateReturn" type="xsd:int"/>
</message>
<message name="cklockRequest">
<part name="login" type="xsd:string"/>
</message>
<message name="cklockResponse">
<part name="cklockReturn" type="xsd:int"/>
</message>
<message name="vlockRequest">
<part name="login" type="xsd:string"/>
<part name="reason" type="xsd:string"/>
</message>
<message name="vlockResponse">
<part name="vlockReturn" type="xsd:int"/>
</message>
<wsdl:portType name="CommonControllerPortType">
<wsdl:operation name="authenticate">
<wsdl:input message="tns:authenticateRequest"/>
<wsdl:output message="tns:authenticateResponse"/>
</wsdl:operation>
<wsdl:operation name="cklock">
<wsdl:input message="tns:cklockRequest"/>
<wsdl:output message="tns:cklockResponse"/>
</wsdl:operation>
<wsdl:operation name="vlock">
<wsdl:input message="tns:vlockRequest"/>
<wsdl:output message="tns:vlockResponse"/>
</wsdl:operation>
</wsdl:portType>
<binding name="CommonControllerBinding" type="tns:CommonControllerPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="authenticate">
<soap:operation soapAction="http://lanaccess.skynet.ua/service/call/common&method=authenticate" style="rpc"/>
<wsdl:input>
<soap:body use="literal" namespace="http://schema.example.com"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" namespace="http://schema.example.com"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="cklock">
<soap:operation soapAction="http://lanaccess.skynet.ua/service/call/common&method=cklock" style="rpc"/>
<wsdl:input>
<soap:body use="literal" namespace="http://schema.example.com"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" namespace="http://schema.example.com"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="vlock">
<soap:operation soapAction="http://lanaccess.skynet.ua/service/call/common&method=vlock" style="rpc"/>
<wsdl:input>
<soap:body use="literal" namespace="http://schema.example.com"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" namespace="http://schema.example.com"/>
</wsdl:output>
</wsdl:operation>
</binding>
<wsdl:service name="CommonController">
<wsdl:port name="CommonControllerPort" binding="tns:CommonControllerBinding">
<soap:address location="http://lanaccess.skynet.ua/service/call/common"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions> |
|