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

Re: [soaplite] SOAP::Lite server and client functionality in same script?

Expand Messages
  • Paul Kulchenko
    Hi, Sean! you shouldn t have problem with that specifying use SOAP::Lite as many times as you want. For example, use SOAP::Lite proxy = .....; # some code
    Message 1 of 2 , Apr 30 3:08 PM
    View Source
    • 0 Attachment
      Hi, Sean!

      you shouldn't have problem with that specifying 'use SOAP::Lite' as
      many times as you want. For example,

      use SOAP::Lite
      proxy => .....;

      # some code here

      use SOAP::Lite
      uri => .....;

      will do the same as

      use SOAP::Lite
      proxy => ....,
      uri => ....,
      ;

      but keep in mind that 'use' executed in COMPILE time, so you in my
      example uri will be specified even in '# some code here'. If you want
      to delay this execution, use

      eval 'use SOAP::Lite ....; 1' or die;

      As for server side, you should be able to do it even with one use:

      (daemon server)

      #!d:\perl\bin\perl.exe
      #!/bin/env perl

      use SOAP::Lite +autodispatch =>
      proxy => 'http://services.soaplite.com/echo.cgi',
      uri => 'http://www.soaplite.com/Echo',
      ;

      my $daemon = SOAP::Transport::HTTP::Daemon
      -> new (LocalAddr => 'localhost', LocalPort => 80)
      -> dispatch_to('longecho')
      ;
      print "Contact to SOAP server at ", $daemon->url, "\n";
      $daemon->handle;

      sub longecho {
      shift;
      return join '', "echo says: ", echo(@_);
      }

      In this example echo() call goes to soaplite server and returns
      result. Works for me :)

      Best wishes, Paul.

      --- Sean.Meisner@... wrote:
      >
      > Hi all,
      > I have a nicely working standalone SOAP server implemented using
      > SOAP::Transport::HTTP::Daemon . I now need to have this server
      > send messages to another server process, and I am considering using
      > SOAP::Transport::HTTP::Daemon to implement this new server. So my
      > original server would then need to act as both a SOAP server and a
      > SOAP
      > client. Has anyone attempted this before? I know that
      > SOAP::Transport::HTTP.pm
      > has a "use SOAP::Lite" in it, so I'm inclined to think that I won't
      > be able to
      > "use" it again to pass in my client setup parameters.. but it would
      > be cool
      > if I could :o) .
      > Thanks,
      >
      > Sean Meisner
      >
      >
      >
      > 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! Auctions - buy the things you want at great prices
      http://auctions.yahoo.com/
    Your message has been successfully submitted and would be delivered to recipients shortly.