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

Re: [soaplite] Re: client-server forwarding trickery

Expand Messages
  • Paul Kulchenko
    Hi, Michael! While other methods for $soap object you may stack with arrow syntax (- ) because they return $soap object itself (when assigned value), method
    Message 1 of 9 , Apr 12, 2001
    • 0 Attachment
      Hi, Michael!

      While other methods for $soap object you may stack with arrow syntax
      (->) because they return $soap object itself (when assigned value),
      method call always returns SOAP::SOM object which gives you access to
      the results of call:

      my $soap = SOAP::Lite->....;
      my $som = $soap->method(@parameters);
      print $som->result;

      which is the same as:

      print $soap->method(@parameters)->result;

      You skip assignment of result of method call, and got the wrong
      results. Hope it helps.

      Best wishes, Paul.

      --- mbrutsch@... wrote:
      > Paul,
      >
      > I am setting up an object, like so:
      >
      > my $soap = SOAP::Lite
      > ->uri/proxy/etc();
      >
      > my $object = $soap
      > -> call(new => parm1,
      > => parm2)
      > -> result;
      >
      > Then I call a method on that object:
      >
      > my $result = $soap
      > -> method($object)
      > -> result;
      >
      > $result contains the result. However, if I split the $soap->result
      > off, like so:
      >
      > $soap
      > -> method($object);
      >
      > my $result = $soap
      > -> result;
      >
      > I always get '1' as a result. I'm trying to use the following line
      > you sent me last week:
      >
      > > print $soap->fault ? $soap->faultstring : $soap->result;
      >
      > What am I doing wrong?
      >
      > Thanks,
      > Michael
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      >


      __________________________________________________
      Do You Yahoo!?
      Get email at your own domain with Yahoo! Mail.
      http://personal.mail.yahoo.com/
    • Michael Percy
      Michael, As I understand it, you need to create a response object to access the ... my $soap = SOAP::Lite - proxy($proxy) - uri($uri); my $response =
      Message 2 of 9 , Apr 12, 2001
      • 0 Attachment
        Michael,
        As I understand it, you need to create a response object to access the
        result. For example:

        ---
        my $soap = SOAP::Lite
        -> proxy($proxy)
        -> uri($uri);

        my $response = $soap->call($method => (@args));

        # Exit error if there is a transport problem
        if (!ref $response) {
        print STDERR "Error: Transport: ", $soap->transport->status, "\n";
        exit(1);
        }

        # Exit error if there is an application problem
        if ($response->fault) {
        print STDERR "Error: ", $response->faultcode, ": ",
        $response->faultstring, "\n";
        print STDERR " ", $response->faultdetail, "\n";
        exit(1);
        }

        # Exit success if everything goes ok
        print $response->result;
        exit(0);
        ---

        Hope that helps,
        Mike

        > -----Original Message-----
        > From: mbrutsch@... [mailto:mbrutsch@...]
        > Sent: Thursday, April 12, 2001 11:07 AM
        > To: soaplite@yahoogroups.com
        > Subject: [soaplite] Re: client-server forwarding trickery
        >
        >
        > Paul,
        >
        > I am setting up an object, like so:
        >
        > my $soap = SOAP::Lite
        > ->uri/proxy/etc();
        >
        > my $object = $soap
        > -> call(new => parm1,
        > => parm2)
        > -> result;
        >
        > Then I call a method on that object:
        >
        > my $result = $soap
        > -> method($object)
        > -> result;
        >
        > $result contains the result. However, if I split the $soap->result
        > off, like so:
        >
        > $soap
        > -> method($object);
        >
        > my $result = $soap
        > -> result;
        >
        > I always get '1' as a result. I'm trying to use the following line
        > you sent me last week:
        >
        > > print $soap->fault ? $soap->faultstring : $soap->result;
        >
        > What am I doing wrong?
        >
        > Thanks,
        > Michael
        >
        >
        > ------------------------ Yahoo! Groups Sponsor
        > ---------------------~-~>
        > Find software faster. Search more than 20,000
        > software solutions on KnowledgeStorm. Register
        > now and get started.
        > http://us.click.yahoo.com/HTDXJD/uMSCAA/zf4EAA/WNqXlB/TM
        > --------------------------------------------------------------
        > -------_->
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        http://docs.yahoo.com/info/terms/
      Your message has been successfully submitted and would be delivered to recipients shortly.