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

OO Perl and Soap...please help!

Expand Messages
  • bcase@telus.net
    hello. I have created a soap server that serves out a class. how do i instantiate a class object on the client end and have access to the object methods. for
    Message 1 of 2 , Nov 28, 2001
    • 0 Attachment
      hello.

      I have created a soap server that serves out a class. how do i
      instantiate a class object on the client end and have access to the
      object methods.

      for example - i instantiate an object on the client end and call the
      object method "pop3Connect"....i get this error that it can find it
      #Can't locate object method "pop3Connect" via package "SOAP::SOM"
      it is looking in the wrong place.

      your help is much appreciated.
      Jeremy Aiyaduria

      _client.pl____________________________________________________________
      #!perl -w

      use SOAP::Lite;


      my $login = "####";
      my $pass = "###";
      my $smtphost = "##.##.##";


      my $soap = SOAP::Lite
      ->uri( 'http://localhost/SendRecieve' )
      ->proxy ('tcp://localhost:8080');

      my $Retrieve = $soap->SendReceive->new(
      Pop3Login => $login,
      Pop3Pass => $pass,
      Pop3Host => $smtphost
      );

      $Retrieve->pop3Connect();


      #Can't locate object method "pop3Connect" via package "SOAP::SOM" at
      #D:\backup\cl
      #ient.pl line 38.
    • Paul Kulchenko
      Hi, Jeremy! ... notice you have typo here ---------^^^^^^^^^^^ ... If you want to call method new() from class SendReceive code will look like: # CLASS name is
      Message 2 of 2 , Nov 28, 2001
      • 0 Attachment
        Hi, Jeremy!

        > my $soap = SOAP::Lite
        > ->uri( 'http://localhost/SendRecieve' )
        notice you have typo here ---------^^^^^^^^^^^
        > ->proxy ('tcp://localhost:8080');

        > my $Retrieve = $soap->SendReceive->new(
        > Pop3Login => $login,
        > Pop3Pass => $pass,
        > Pop3Host => $smtphost
        > );
        If you want to call method new() from class SendReceive code will
        look like:

        # CLASS name is already in uri()
        my $Retrieve = $soap->SOAP::new(
        Pop3Login => $login,
        Pop3Pass => $pass,
        Pop3Host => $smtphost
        )->result;

        -- OR --

        my $Retrieve = $soap->call('new',
        Pop3Login => $login,
        Pop3Pass => $pass,
        Pop3Host => $smtphost
        )->result;

        you can also use autodispatch mode:

        use SOAP::Lite +autodispatch =>
        uri => 'http://localhost/SendReceive',
        proxy => 'tcp://localhost:8080'
        ;

        my $Retrieve = SendReceive->new(
        Pop3Login => $login,
        Pop3Pass => $pass,
        Pop3Host => $smtphost
        );
        $Retrieve->pop3Connect();

        Hope it helps.

        Best wishes, Paul.

        --- bcase@... wrote:
        > hello.
        >
        > I have created a soap server that serves out a class. how do i
        > instantiate a class object on the client end and have access to the
        >
        > object methods.
        >
        > for example - i instantiate an object on the client end and call
        > the
        > object method "pop3Connect"....i get this error that it can find it
        > #Can't locate object method "pop3Connect" via package "SOAP::SOM"
        > it is looking in the wrong place.
        >
        > your help is much appreciated.
        > Jeremy Aiyaduria
        >
        >
        _client.pl____________________________________________________________
        > #!perl -w
        >
        > use SOAP::Lite;
        >
        >
        > my $login = "####";
        > my $pass = "###";
        > my $smtphost = "##.##.##";
        >
        >
        > my $soap = SOAP::Lite
        > ->uri( 'http://localhost/SendRecieve' )
        > ->proxy ('tcp://localhost:8080');
        >
        > my $Retrieve = $soap->SendReceive->new(
        > Pop3Login => $login,
        > Pop3Pass => $pass,
        > Pop3Host => $smtphost
        > );
        >
        > $Retrieve->pop3Connect();
        >
        >
        > #Can't locate object method "pop3Connect" via package "SOAP::SOM"
        > at
        > #D:\backup\cl
        > #ient.pl line 38.
        >
        >
        > ------------------------ 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!?
        Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
        http://geocities.yahoo.com/ps/info1
      Your message has been successfully submitted and would be delivered to recipients shortly.