root/trunk/tools/test_wsdl.php

Revision 64, 1.1 kB (checked in by yann, 5 years ago)

wsdl test send data...
encoding : utf-8

Line 
1 <?php
2 require_once(dirname(__FILE__) . '/../lib/nusoap.php');
3
4 $wsdl_url = 'http://www.iminr.com/mining/wsMining.asmx?WSDL';
5 $default_params = array (
6     'webSiteId' => 10271,
7     'ip' => '62.202.16.183',
8 );
9
10 function wp_iminr_soap_tracker($params) {
11     global $client;
12     global $default_params;
13     global $wsdl_url;
14     
15     $results = array();
16     
17     if (! isset($client) ) {
18         echo "Create SOAP client...\n";
19         $client = new soapclient($wsdl_url, true);
20         $client->setDebugLevel(1);
21     }
22     
23     foreach ($params as $name => $value) {
24         echo "add '$value' in '$name'\n";
25         $request_params = array(
26             'parameters' => array_merge($default_params, array('name' => $name, 'val' => $value))
27         );
28         $results[$name] = $client->call('wsSendValue', $request_params);
29     }
30     
31     return $results;
32 }
33
34 $params = array (
35     'wp_posts' => 1,
36     'wp_post_users' => 'Garko',
37     'wp_post_categories' => 'Autres',
38     'wp_null' => 'No'
39 );
40
41 $results = wp_iminr_soap_tracker($params);
42 echo "\nResults:\n";
43 foreach ($results as $name => $result) {
44     echo "$name : " . $result['wsSendValueResult'] . "\n";
45 }
46
47 /*
48 echo "\nDebug:\n";
49 echo $client->getDebug();
50 */
51 ?>
Note: See TracBrowser for help on using the browser.