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

Problem with TCP client/server

Expand Messages
  • Juan Julian Merelo Guervos
    Hi, I m trying to connect a server and a client using TCP transport. When I use autodispatch, it works fine; the example works fine, but when I try to create a
    Message 1 of 2 , Oct 18, 2001
    • 0 Attachment
      Hi,
      I'm trying to connect a server and a client using TCP transport. When I
      use autodispatch, it works fine; the example works fine, but when I try
      to create a SOAP object this way:

      my $soap = SOAP::Lite->uri( 'http://geneura.ugr.es/CH' )
      ->proxy ('tcp://localhost:8002')
      ->on_fault( sub { my($soap, $res) = @_;
      die ref $res ? $res->faultdetail : $soap->transport->status, "\n";
      } );
      ;

      print $soap->test(qw( a b c ))->result, "\n\n";

      I can't manage it to work. Server is this:
      my $port = shift || 8002;
      my $daemon = SOAP::Transport::TCP::Server
      -> new (LocalAddr => 'localhost', LocalPort => $port, Listen => 5,
      Reuse => 1)
      -> dispatch_to( ClearingHouse );
      print "Contact to SOAP server at ", join(':', $daemon->sockhost,
      $daemon->sockport), "\n";
      $daemon->handle;
      package ClearingHouse;
      sub test{
      return "Test", @_;
      }

      Pretty classical, right? Maybe I can't figure out the syntax, but I have
      tried call( test => ...) and it doesn't work either. The server issues
      this error:

      Use of uninitialized value in join or string at
      /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 2046.
      Use of uninitialized value in join or string at
      /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 2046.
      SOAP::Serializer::envelope: Client Denied access to method (test) in
      class (main) at /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line
      1936.

      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      Use of uninitialized value in numeric eq (==) at
      /usr/local/lib/perl5/site_perl/5.6.1/IO/SessionData.pm line 160.

      And so on...

      Any help?

      J


      --
      JJ Merelo => http://geneura.ugr.es/~jmerelo
      OPEAL => http://opeal.sourceforge.net
      PPSN2002 => http://ppsn2002.ugr.es
    • Paul Kulchenko
      Hi, Juan! ... No, syntax is correct. Problem is that URI doesn t correlate with ... and ... Your URL should have ClearingHouse as PATH: my $soap =
      Message 2 of 2 , Oct 18, 2001
      • 0 Attachment
        Hi, Juan!

        > Pretty classical, right? Maybe I can't figure out the syntax, but I
        No, syntax is correct. Problem is that URI doesn't correlate with
        package on server side:

        > my $soap = SOAP::Lite->uri( 'http://geneura.ugr.es/CH' )
        and
        > package ClearingHouse;

        Your URL should have ClearingHouse as PATH:

        my $soap = SOAP::Lite->uri( 'http://geneura.ugr.es/ClearingHouse' )
        or you need to do dispatch differently to resolve your URI to class
        ClearingHouse. Let me know if you still have problems.

        Best wishes, Paul.

        --- Juan Julian Merelo Guervos <jmerelo@...> wrote:
        > Hi,
        > I'm trying to connect a server and a client using TCP transport.
        > When I
        > use autodispatch, it works fine; the example works fine, but when I
        > try
        > to create a SOAP object this way:
        >
        > my $soap = SOAP::Lite->uri( 'http://geneura.ugr.es/CH' )
        > ->proxy ('tcp://localhost:8002')
        > ->on_fault( sub { my($soap, $res) = @_;
        > die ref $res ? $res->faultdetail : $soap->transport->status,
        > "\n";
        > } );
        > ;
        >
        > print $soap->test(qw( a b c ))->result, "\n\n";
        >
        > I can't manage it to work. Server is this:
        > my $port = shift || 8002;
        > my $daemon = SOAP::Transport::TCP::Server
        > -> new (LocalAddr => 'localhost', LocalPort => $port, Listen =>
        > 5,
        > Reuse => 1)
        > -> dispatch_to( ClearingHouse );
        > print "Contact to SOAP server at ", join(':', $daemon->sockhost,
        > $daemon->sockport), "\n";
        > $daemon->handle;
        > package ClearingHouse;
        > sub test{
        > return "Test", @_;
        > }
        >
        > Pretty classical, right? Maybe I can't figure out the syntax, but I
        > have
        > tried call( test => ...) and it doesn't work either. The server
        > issues
        > this error:
        >
        > Use of uninitialized value in join or string at
        > /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 2046.
        > Use of uninitialized value in join or string at
        > /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 2046.
        > SOAP::Serializer::envelope: Client Denied access to method (test)
        > in
        > class (main) at /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm
        > line
        > 1936.
        >
        > SOAP::Data::new: ()
        > SOAP::Data::new: ()
        > SOAP::Data::new: ()
        > SOAP::Data::new: ()
        > SOAP::Data::DESTROY: ()
        > SOAP::Data::DESTROY: ()
        > SOAP::Data::DESTROY: ()
        > SOAP::Data::DESTROY: ()
        > SOAP::Data::DESTROY: ()
        > SOAP::Data::DESTROY: ()
        > SOAP::Data::DESTROY: ()
        > SOAP::Data::new: ()
        > SOAP::Data::new: ()
        > SOAP::Data::new: ()
        > Use of uninitialized value in numeric eq (==) at
        > /usr/local/lib/perl5/site_perl/5.6.1/IO/SessionData.pm line 160.
        >
        > And so on...
        >
        > Any help?
        >
        > J
        >
        >
        > --
        > JJ Merelo => http://geneura.ugr.es/~jmerelo
        > OPEAL => http://opeal.sourceforge.net
        > PPSN2002 => http://ppsn2002.ugr.es
        >
        > 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!?
        Make a great connection at Yahoo! Personals.
        http://personals.yahoo.com
      Your message has been successfully submitted and would be delivered to recipients shortly.