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

Dispatching to more than one SOAP server

Expand Messages
  • amoore
    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
    Message 1 of 2 , Apr 8 8:57 AM
    • 0 Attachment
      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.

      Thanks!
      -Andy
    • Rico Pamplona
      Hi! Some web services require an array for an input in the client like I ve seen in some .NET or Delphi built service, can I make a client to access this in
      Message 2 of 2 , Apr 8 9:40 AM
      • 0 Attachment

        Hi!

        Some web services require an array for an input in the client like I've seen in some .NET or Delphi built service,  can I make a client to access this in Perl SOAP Lite ?

        Can I do something like this for the client?

        use SOAP::Lite;

        my @batchdata = ('First Record',   'Second Record', 'Third Record');

        my $soap = SOAP::Lite
            -> service('http://some.web.service");

        my $result = $soap->SendArrayInput( @batchdata);

        Thanks,

        Rico Pamplona



        Do you Yahoo!?
        Yahoo! Tax Center - File online, calculators, forms, and more
      Your message has been successfully submitted and would be delivered to recipients shortly.