[ Index ]
 

Code source de nusoap 0.7.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/samples/ -> wsdlclient8.php (source)

   1  <?php
   2  /*

   3   *    $Id: wsdlclient8.php,v 1.1 2004/03/31 21:04:30 snichol Exp $

   4   *

   5   *    WSDL client sample.

   6   *

   7   *    Service: WSDL

   8   *    Payload: document/literal

   9   *    Transport: http

  10   *    Authentication: digest

  11   */
  12  require_once ('../lib/nusoap.php');
  13  $proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
  14  $proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
  15  $proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
  16  $proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
  17  echo 'You must set your username and password in the source';
  18  exit();
  19  $username = '';
  20  $password = '';
  21  $client = new soapclient("http://staging.mappoint.net/standard-30/mappoint.wsdl", true,
  22                          $proxyhost, $proxyport, $proxyusername, $proxypassword);
  23  $err = $client->getError();
  24  if ($err) {
  25      echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
  26  }
  27  $client->setCredentials($username, $password, 'digest');
  28  $address = array(
  29      'AddressLine' => '563 Park Avenue',
  30      'PrimaryCity' => 'New York',
  31      'SecondaryCity' => 'Brooklyn',
  32      'Subdivision' => '',
  33      'PostalCode' => '',
  34      'CountryRegion' => 'US',
  35      'FormattedAddress' => ''
  36  );
  37  $findRange = array(
  38      'StartIndex' => 0,
  39      'Count' => 10
  40  );
  41  $findResultMask = 'AddressFlag';
  42  $findOptions = array(
  43      'Range' => $findRange,
  44      'SearchContext' => 1,
  45      'ResultMask' => $findResultMask,
  46      'ThresholdScore' => 0.85
  47  );
  48  $findAddressSpecification = array(
  49      'DataSourceName' => 'MapPoint.NA',
  50      'InputAddress' => $address,
  51      'Options' => $findOptions
  52  );
  53  $findAddress = array('specification' => $findAddressSpecification);
  54  $result = $client->call('FindAddress', array('parameters' => $findAddress));
  55  // Check for a fault

  56  if ($client->fault) {
  57      echo '<h2>Fault</h2><pre>';
  58      print_r($result);
  59      echo '</pre>';
  60  } else {
  61      // Check for errors

  62      $err = $client->getError();
  63      if ($err) {
  64          // Display the error

  65          echo '<h2>Error</h2><pre>' . $err . '</pre>';
  66      } else {
  67          // Display the result

  68          echo '<h2>Result</h2><pre>';
  69          print_r($result);
  70          echo '</pre>';
  71      }
  72  }
  73  echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
  74  echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
  75  echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
  76  ?>


Généré le : Mon Sep 10 13:53:24 2007 par Balluche grâce à PHPXref 0.7