Changeset 61

Show
Ignore:
Timestamp:
02/20/07 13:01:16 (5 years ago)
Author:
yann
Message:

use nusoap library for SOAP access (can be included in plugin package)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tools/test_wsdl.php

    r55 r61  
    11<?php 
     2 
     3require_once('./lib/nusoap.php'); 
    24 
    35$wsdl_url = 'http://www.iminr.com/mining/wsMining.asmx?WSDL'; 
    46 
    5 $client = new SoapClient($wsdl_url, array('trace' => 1, 'exceptions' => 0)); 
     7$default_params = array ( 
     8        'webSiteId' => '10271', 
     9        'ip' => '62.202.16.183', 
     10); 
    611 
     12function wp_iminr_soap_tracker($params) { 
     13        global $client; 
     14        global $default_params; 
     15        global $wsdl_url; 
     16         
     17        if (! isset($client) ) { 
     18                echo "Create SOAP client...\n"; 
     19                $client = new soapclient($wsdl_url, true); 
     20        } 
     21         
     22        return $client->call('wsSendValue', array_merge($params, $default_params)); 
     23} 
     24 
     25 
     26// wp_posts 
    727$params = array ( 
    8         'webSiteId' => '10271', 
    9         'ip' => '83.78.14.96', 
    1028        'name' => 'wp_posts', 
    1129        'val' => 1 
    1230); 
     31$result = wp_iminr_soap_tracker($params); 
     32echo "wp_posts : " . $result['wsSendValueResult'] . "\n"; 
    1333 
    14 $client->wsSendValue($params); 
     34// wp_post_users 
     35$params = array ( 
     36        'name' => 'wp_post_users', 
     37        'val' => 'Garko' 
     38); 
     39$result = wp_iminr_soap_tracker($params); 
     40echo "wp_post_users : " . $result['wsSendValueResult'] . "\n"; 
    1541 
    16 echo "wp_posts : " . $client->__getLastResponse() . "<br />\n"; 
    17  
    18 $params['name'] = 'wp_post_users'; 
    19 $params['val']  = 'Garko'; 
    20  
    21 $client->wsSendValue($params); 
    22  
    23 echo "wp_post_users : " . $client->__getLastResponse() . "<br />\n"; 
    24  
    25 $params['name'] = 'wp_post_categories'; 
    26 $params['val']  = 'Autres'; 
    27  
    28 $client->wsSendValue($params); 
    29  
    30 echo "wp_post_categories : " . $client->__getLastResponse() . "<br />\n"; 
     42// wp_post_categories 
     43$params = array ( 
     44        'name' => 'wp_post_categories', 
     45        'val' => 'Autres' 
     46); 
     47$result = wp_iminr_soap_tracker($params); 
     48echo "wp_post_categories : " . $result['wsSendValueResult'] . "\n"; 
    3149 
    3250?>