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

2505using more than one SOAP server

Expand Messages
  • amoore
    Apr 8 9:07 AM
      Hi -

      I have an application from which I would like to be able to access more than
      one SOAP server. I'd like to be able to use the autodispatch (or
      dispatch_from) type of syntanx because it seems like the only way to
      instantiate an object on the server side and then call methods on it. (Correct
      and guide me if I'm wrong there.)

      I'm having problems because with the autodispatch syntax, you specify your
      uri and proxys at import time. Since you can only import the module once, I
      don't see how I can specify different endpoints. My clients are running under
      mod_perl, in case that makes any difference.

      In other words, I use

      use SOAP::Lite +autodispatch =>
      uri => 'http://soapserver1.example.com/Animal/Dog',
      proxy => 'http://soapserver1.example.com/animals/soapproxy.cgi';

      my $fido = Animal::Dog->new( 'lab' );
      and then call methods on $fido like $fido->bark();
      and it works fine. Or, I can do:

      use SOAP::Lite +autodispatch =>
      uri => 'http://soapserver2.example.com/Plant/Tree',
      proxy => 'http://soapserver2.example.com/plants/soapproxy.cgi';

      my $leafy = Plant::Tree->new('oak');
      and call methods on $leafy
      which works fine.

      I can't, however, do them both in the same script.

      Is there any way to specify to dispatch_from Animal::Dog to one endpoint
      and dispatch_from Plant::Tree to another?

      I'd appreciate any help or insight you can provide.