root/docs/usc/nautilus/usr2/prod/buoys/perl/xml/nusoap/samples/wsdlclient9.php

Revision 113 (checked in by jcothran, 5 years ago)

example php/perl script to process nerrs cdmo web service data to Xenia database.

Line 
1 <?php
2 /*
3  *    $Id: wsdlclient9.php,v 1.1 2004/04/13 13:12:53 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 = 'xxxxxx';
20 $password = 'xxxxxx';
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 $view = array(
29     'Height' => 200,
30     'Width' => 300,
31     'CenterPoint' => array(
32         'Latitude' => 40,
33         'Longitude' => -120
34     )
35 );
36 $myViews[] = new soapval('MapView', 'ViewByHeightWidth', $view, false, 'http://s.mappoint.net/mappoint-30/');
37 $mapSpec = array(
38     'DataSourceName' => "MapPoint.NA",
39     'Views' => array('MapView' => $myViews)
40 );
41 $map = array('specification' => $mapSpec);
42 $result = $client->call('GetMap', array('parameters' => $map));
43 // Check for a fault
44 if ($client->fault) {
45     echo '<h2>Fault</h2><pre>';
46     print_r($result);
47     echo '</pre>';
48 } else {
49     // Check for errors
50     $err = $client->getError();
51     if ($err) {
52         // Display the error
53         echo '<h2>Error</h2><pre>' . $err . '</pre>';
54     } else {
55         // Display the result
56         echo '<h2>Result</h2><pre>';
57         print_r($result);
58         echo '</pre>';
59     }
60 }
61 echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
62 echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
63 echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
64 ?>
65
Note: See TracBrowser for help on using the browser.