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

836Re: One More Question

Expand Messages
  • judson@mcs.anl.gov
    Sep 19, 2001
      Ok, this is so cool. I've almost made everything work.

      But doing what this thread says hasn't worked for me.

      The code:

      use strict;
      use SOAP::Lite 'debug';

      my ($uri);

      BEGIN {
      $uri = 'http://alchesay.mcs.anl.gov:1180/';

      use SOAP::Lite +autodispatch =>
      uri => $uri,
      proxy => $uri,
      debug => sub { print @_; }
      ;
      }

      my $videoC = AccessGrid::Node::VideoControl->new();
      print $videoC->killVideoApp();

      exit 0

      Still claims to fail with no transport specified. Ideas?

      --Ivan













      --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
      > Hi, Craig!
      >
      > > my $uri = "http://localhost/";
      > > my $proxy = "http://localhost:1983/";
      > >
      > > use SOAP::Lite +autodispatch =>
      > > uri => $uri,
      > > proxy => $proxy,
      > > debug => sub { print @_; }
      > > ;
      > Answer is simple. 'use' code is executed during the COMPILE stage
      and
      > value of $proxy (and $uri) variable is undefined. It WILL be defined
      > during the EXECUTION phase, but use block alredy executed by that
      > time. You need to wrap it in BEGIN block:
      >
      > BEGIN {
      > my $uri = "http://localhost/";
      > my $proxy = "http://localhost:1983/";
      >
      > use SOAP::Lite +autodispatch =>
      > uri => $uri,
      > proxy => $proxy,
      > debug => sub { print @_; }
      > ;
      > }
      >
      > or wrap 'use' in eval to delay execution:
      >
      > my $uri = "http://localhost/";
      > my $proxy = "http://localhost:1983/";
      >
      > eval q!
      > use SOAP::Lite +autodispatch =>
      > uri => $uri,
      > proxy => $proxy,
      > debug => sub { print @_; }
      > ;
      > 1;
      > ! or die;
      >
      > or write proxy => 'http://...';
      >
      > Should help. Let me know if you have any other questions.
      >
      > Best wishes, Paul.
      >
      > --- Craig Kelley <kellcrai@i...> wrote:
      > >
      > > Hello Again,
      > >
      > > I have my code working fine, but I was wondering why this specific
      > > example
      > > is wrong:
      > >
      > > --= Server =--
      > > use strict;
      > > use SOAP::Transport::HTTP;
      > >
      > > $SIG{PIPE} = 'IGNORE';
      > >
      > > my $daemon = SOAP::Transport::HTTP::Daemon
      > > -> new (LocalPort => 1983)
      > > ->
      > >
      > dispatch_to
      ('/usr/local/home/ink/programming/pharmon/server/server_mods')
      > > ;
      > >
      > > print "Contact to SOAP server at ", $daemon->url, "\n";
      > > $daemon->handle;
      > >
      > >
      > >
      > > --= Client =--
      > > use strict;
      > > use Carp;
      > >
      > > my $uri = "http://localhost/";
      > > my $proxy = "http://localhost:1983/";
      > >
      > > use SOAP::Lite +autodispatch =>
      > > uri => $uri,
      > > proxy => $proxy,
      > > debug => sub { print @_; }
      > > ;
      > >
      > >
      > >
      > > The server works fine. The BEGIN{} for the SOAP::Lite client
      > > always dies
      > > with this error message:
      > >
      > > proxy: transport protocol not specified
      > > BEGIN failed--compilation aborted at ./client.pl line 22.
      > >
      > > I looked through the Lite.pm code and found that proxy() was being
      > > called
      > > with a single null parameter (which fired the error message).
      > > Going
      > > backwards from there seemed a bit daunting :)
      > >
      > > PS - When is the Perl SOAP::Lite book coming out? :)
      > >
      > > -Craig
      > >
      > >
      > >
      > > To unsubscribe from this group, send an email to:
      > > soaplite-unsubscribe@y...
      > >
      > >
      > >
      > > Your use of Yahoo! Groups is subject to
      > > http://docs.yahoo.com/info/terms/
      > >
      > >
      >
      >
      > __________________________________________________
      > Do You Yahoo!?
      > Yahoo! Auctions - buy the things you want at great prices
      > http://auctions.yahoo.com/
    • Show all 13 messages in this topic