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

1700Re: [soaplite] Can't locate object method "result" via package "Hello Torsten"

Expand Messages
  • Duncan Cameron
    Jul 18, 2002
      On 2002-07-17 tmangner wrote:
      >i have some problems with using WSDL and SOAP::Lite ...
      >why do i get this error when starting the client:
      >>perl hello_clientwsdl.pl Torsten
      >Can't locate object method "result" via package "Hello Torsten" at
      >hello_clientwsdl.pl line 16.
      >why doas the server want to access a package "Hello Torsten", which
      >should be the requested output? and what is the "result" method?
      >can anyone help me?
      >thanks in advance,
      >#the source files
      ># hello.cgi - Hello Server
      >use SOAP::Transport::HTTP;
      > ->dispatch_to('Hello')
      > ->handle;
      >package Hello;
      >sub sayHello {
      > shift;
      > my $result = SOAP::Data
      > ->name('sayHelloResult')
      > ->uri('http://alphaone.de/Hello')
      > ->value('Hello ' . shift);
      > return $result;
      ># hello_client.pl - Hello Client
      >use SOAP::Lite;
      >my $name = shift;
      >print "\n\ncalling the soap server to say hello\n\n";
      >print "the soap server says: ";
      >my $soap = SOAP::Lite
      > -> service
      >print $soap -> sayHello( $name )-> result;
      >print "\n\n";

      When you use the service() method SOAP::Lite automatically calls the result()
      method and passes its result back to you.

      So your client is trying to call result() on the retuened value which is 'Hello Torsten'

      If you don't want this to happen then use the proxy() and uri() methods instead
      of service()

      Duncan Cameron
    • Show all 2 messages in this topic