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

Re: problem with the constructor and method involkation.

Expand Messages
  • naga_cit
    If that is the case, is there a way I can pass the hash values in the call method. The syntax for call given as call(new= @arguments); But in my case I need to
    Message 1 of 3 , Jan 30, 2005
    • 0 Attachment
      If that is the case,

      is there a way I can pass the hash values in the call method.
      The syntax for call given as
      call(new=>@arguments);
      But in my case I need to create a constructor like
      new(path=>'c:/SWAT', value=>'hi'); How do implement the same with
      call method.

      If I am not wrong. Autodispatch ... automatically sends the SOAP
      request to the given uri. Is there a way I can send SOAP request to
      multiple server with different methods.

      like $server1->method1();
      $server2->anothermethod(); using auto dispatch.

      Thanks,
      Nagarajan


      --- In soaplite@yahoogroups.com, "Duncan Cameron"
      <duncan_cameron2002@y...> wrote:
      > On 2005-01-30 at 08:35:18 naga_cit wrote:
      >
      > >Hi All,
      > >
      > >I have problem with 'new' constructor.
      > >I tried to create a constructor with the name 'new'
      > >my $obj= $sta1->new(setuppath=>'C:/SWAT')->result;
      > >it never worked. If I do the same by changing the constructor
      name
      > >to something else (newone) in the server side. It is working.
      What
      > >is wrong with the syntax.
      > >
      > S::L interprets the new() method as a call to its own new()
      method,
      > not to your remote method.
      > This is explained in the docs, see the description of the call()
      > method.
      >
      > >'object->method()' syntax has problem with SOAP lite.
      > > my $a= $sta1->$obj->Uninstall_App_Driver()->result; is throwing
      > >error, only my $a= $sta1->Uninstall_App_Driver($obj)->result;
      syntax
      > >is working. (method(object)).
      > >
      > >Whats wrong in the syntax?
      > Only that S::L does not support it!
      >
      > If you are trying to pass objects back and forward between the
      client
      > and server then you should look at autodispatch. Otherwise you
      will
      > explicitly have to pass the object as a parameter on each call. As
      > you have done in your example below.
      > >
      > >Thanks,
      > >Nagarajan
      > >
      > >Client:
      > >========
      > >
      > > use SOAP::Lite;
      > > my $sta1 = SOAP::Lite
      > > -> uri('http://10.10.7.21/Ins)
      > > -> proxy('http://10.10.7.21/daemon.pl');
      > >
      > > my $obj= $sta1->new(setuppath=>'C:/SWAT')->result;
      > > my $a= $sta1->Uninstall_App_Driver($obj)->result;
      > >
      > >Constructor on the server side:
      > >===============================
      > >sub new{
      > >
      > > my ($class, %args) = @_;
      > > my $self=\%args;
      > > bless $self, 'Ins';
      > > return $self;
      > >
      > > }
      > >sub ....
      > >
      > This looks like it should work.
      >
      > Regards
      > Duncan
    Your message has been successfully submitted and would be delivered to recipients shortly.