-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnotes_wsdl.php
More file actions
120 lines (110 loc) · 3.68 KB
/
Copy pathnotes_wsdl.php
File metadata and controls
120 lines (110 loc) · 3.68 KB
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
<?php
/**
*
* @author Andres Duarte M.
*
*/
require_once 'lib/nusoap.php';
ini_set("soap.wsdl_cache_enabled", "0"); // deshabilitando cache WSDL
$server = new soap_server();
$server->configureWSDL('wsNotes', 'urn:wsNotes');
$server->wsdl->schemaTargetNamespace = 'urn:wsNotes';
$server->soap_defencoding = 'UTF-8';
$server->decode_utf8 = FALSE;
$server->encode_utf8 = TRUE;
$server->wsdl->addComplexType(
'Item',
'complexType',
'struct',
'all',
'',
array(
'id' => array('name' => 'id', 'type' => 'xsd:int'),
'title'=> array('name' => 'title', 'type' => 'xsd:string'),
'body'=> array('name' => 'body', 'type' => 'xsd:string'),
'created'=> array('name' => 'created', 'type' => 'xsd:string'),
'last_update' => array('name' => 'last_update', 'type' => 'xsd:string')
)
);
$server->wsdl->addComplexType(
'List',
'complexType',
'array',
'',
'',
array(
'Item' => array('name' => 'Item', 'type' => 'tns:Item[]')
)
);
$server->register('read',
array( // request
'ws_user' => 'xsd:string', // obligatorio
'ws_pass' => 'xsd:string', // obligatorio
'id' => 'xsd:int' // opcional
),
array( // response
'Success' => 'xsd:boolean',
'Message' => 'xsd:string',
'Rows' => 'xsd:int',
'List' => 'tns:List'
),
'urn:wsNotes', // namespace
'urn:wsNotes#List', // accion SOAP
'rpc', // estilo
'encoded', // tipo de uso
'Obtiene las notas registradas' // documentacion
);
$server->register('create',
array( // request
'ws_user' => 'xsd:string', // obligatorio
'ws_pass' => 'xsd:string', // obligatorio
'title' => 'xsd:string', // obligatorio
'body' => 'xsd:string' // obligatorio
),
array( // response
'Success' => 'xsd:boolean',
'Message' => 'xsd:string'
),
'urn:wsNotes', // namespace
'', // accion SOAP
'', // estilo
'', // tipo de uso
'Crea una nota' // documentacion
);
$server->register('update',
array( // request
'ws_user' => 'xsd:string', // obligatorio
'ws_pass' => 'xsd:string', // obligatorio
'id' => 'xsd:int', // obligatorio
'title' => 'xsd:string', // obligatorio
'body' => 'xsd:string' // obligatorio
),
array( // response
'Success' => 'xsd:boolean',
'Message' => 'xsd:string'
),
'urn:wsNotes', // namespace
'', // accion SOAP
'', // estilo
'', // tipo de uso
'Actualiza una nota' // documentacion
);
$server->register('delete',
array( // request
'ws_user' => 'xsd:string', // obligatorio
'ws_pass' => 'xsd:string', // obligatorio
'id' => 'xsd:int' // obligatorio
),
array( // response
'Success' => 'xsd:boolean',
'Message' => 'xsd:string'
),
'urn:wsNotes', // namespace
'', // accion SOAP
'', // estilo
'', // tipo de uso
'Elimina una nota' // documentacion
);
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>