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

1301A question on a set of odd errors

Expand Messages
  • Joe Landman
    Mar 13, 2002
    • 0 Attachment
      Folks:

      I am reasonably sure this is a coding error on my part. I have a
      basic client and server set up using SOAP::Lite and the built in http
      transport (server and client). I turned the tracing up to full so I
      could see what was going on.

      In short, soap calls like this

      (client side)

      $remote = SOAP::Lite
      ->uri('http://www.mscsoftware.com/ftld')
      ->proxy('http://'.$remote_host.':10101');

      $remote->call(new)->result;

      results in on the server side

      .
      .
      .
      SOAP::Server::handle:
      SOAP::SOM::DESTROY: ()
      SOAP::Serializer::envelope: ()
      Use of uninitialized value in join or string at
      /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 2229.
      SOAP::Serializer::envelope: Client Failed to locate method (result)
      in class (ftld) at /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm
      line 2180.
      http://squash:10101/
      SOAP::Data::new: ()
      .
      .
      .

      The odd thing is that the calls seem to work... sort of. My server is
      set up like this:

      my $daemon= $transport_server
      -> new (
      LocalPort => $ftld_config{'port'},
      Listen => $ftld_config{'listen'},
      Reuse => 1
      )
      ->dispatch_to('ftld')
      ->objects_by_reference(qw(ftld));

      And the package looks like this :

      package ftld;

      $ftld::VERSION=1.0;
      use strict;
      use Data::Dumper;
      use Carp;
      use SOAP::Lite +trace => qw( fault );
      use constant true => (1==1);
      use constant false => (1==0);
      our (@ISA, $VERSION);
      @ISA = qw(ftld );

      sub new
      {
      my ($class,%args) = @_;
      my $self={};

      bless $self,ref $class || $class ;

      while (my($key,$value) = each %args)
      { $self->set_attribute($key,$value); }
      $self->set_attribute('error',0);
      return $self;
      }
      .
      .
      .

      I dont understand the "SOAP::Serializer::envelope: Client Failed to
      locate method (result) in class (ftld)" message. Isn't it supposed to
      be getting this from the SOAP::Lite base class?


      And this gets to my next problem.

      I instantiate an object using a very similar syntax to the above, to the
      same server.

      $remote = SOAP::Lite
      ->uri('http://www.scientificappliance.com/ftld')
      ->proxy('http://'.$remote_host.':10101');

      $remote->call(new)->result;

      and I call a diagnostic method on the server:

      (server: method inside the package)

      sub burp
      {
      my $self=shift;
      use Data::Dumper;
      print "\n------burp DUMPER------\n",
      Dumper(\$self),
      "\n------END DUMPER------\n\n";
      }

      (client: call to method)

      $remote = SOAP::Lite
      ->uri('http://www.scientificappliance.com/ftld')
      ->proxy('http://'.$remote_host.':10101');

      $return_code=$remote->call(new)->result;
      $return_code=$remote->burp->result;

      Now I go look at the log on the server after this call (and the object
      has been instantiated).

      ------burp DUMPER------

      $VAR1 = \'ftld';


      ------END------

      This means that the object is not an object. It wasn't blessed. My
      "new" message ("in new!!!") never shows up in the log.

      Ok. So this means that my "new" method was not called. Some other
      "new" method was called.

      I am doing this from inside another object. Is this an issue? Does it
      matter if I call the "new" routine "new" or "neuvo" or whatnot else?
      Its just a method... right? As long as I bless the hash properly and
      return it, it should be fine.... ?

      Any clues/hints would be welcome. Thanks!

      Joe
    • Show all 2 messages in this topic