-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathws_client.php
More file actions
74 lines (33 loc) · 927 Bytes
/
ws_client.php
File metadata and controls
74 lines (33 loc) · 927 Bytes
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
<?php
set_include_path(realpath(dirname(__FILE__) . '/inc'));
$service = 'http://localhost/tripugzf/ws_server.php';
$value = 'THIS IS a NEw vaLue';
$method = 'encode';
/**
* Using Zend_Rest_Client
*
*/
/*
require_once 'Zend/Rest/Client.php';
$client = new Zend_Rest_Client($service);
echo "Result is: " . $client->$method($value)->get();
*/
/**
* Using CURL to call the same command
*
*
*/
/*
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $service . '?method=' . $method . '&arg1=' . urlencode($value));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// grab URL and pass it to the browser
$result = curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
$parsed = simplexml_load_string($result);
//echo $result;
echo "Result is: " . $parsed->$method->response;
*/