Loading ...
Sorry, an error occurred while loading the content.
 

Re: [soaplite] Re: PEAR as a client to SOAP::Lite server

Expand Messages
  • Bryce Harrington
    Very cool... I ve been playing with this all afternoon. :-) The one thing I can t quite figure out is if the soap daemon is providing access in an object
    Message 1 of 3 , Jan 17, 2005
      Very cool... I've been playing with this all afternoon. :-)

      The one thing I can't quite figure out is if the soap daemon is
      providing access in an object oriented syntax, how to interact
      with that in PHP. I.e., I'd like to do this:

      <?php
      require('SOAP/Client.php');
      $endpoint = 'http://localhost:8081/';
      $namespace = "http://www.osdl.org/WebService/TestSystem";

      $requester = new SOAP_Client($endpoint);
      $testsys = $requester->call('new', $namespace);

      $response = $requester->call($testsys, 'get_hosts', $namespace);

      if (PEAR::isError($response)) {
      // handle the error condition
      printf("Error: %s<br>\n", $response->getMessage());
      } else {
      foreach ($response as $row) {
      printf("$row <br>\n");
      }
      }

      echo "\n";
      ?>

      But I get the following error:

      Fatal error: Cannot pass parameter 2 by reference in
      /home/bryce/public_html/soap_client.php on line 10

      How do you carry and pass along the constructed Perl object from the new
      call to subsequent calls?

      Bryce



      On Mon, 17 Jan 2005, bobdottaylor wrote:
      > I figured it out on my own... Here is a command line PHP client
      > accessing the SOAP::Lite temperature sample service:
      >
      > #!/usr/bin/php
      > <?php
      > require('SOAP/Client.php');
      > $endpoint = 'http://services.soaplite.com/temper.cgi';
      > $requester = new SOAP_Client($endpoint);
      > $method = 'c2f';
      > $param = '100';
      > $namespace = "http://www.soaplite.com/Temperatures";
      > $response = $requester->call($method, $param, $namespace);
      > printf($response);
      > echo "\n";
      > ?>
      >
      > I hope this helps someone... I didn't find much in this group or on
      > the Internet that specifically provided a sample of a PHP client
      > accessing a Perl SOAP::Lite server...
      >
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.