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

4393Re: How to switch between the servers in autodispatch

Expand Messages
  • naga_cit
    Feb 2, 2005
    • 0 Attachment
      Normal Model:
      =============

      $soap1= new SOAP::Lite
      proxy => 'http://localhost/cgi-bin/soap.cgi',
      uri => 'http://my.own.com/My/Examples';

      $obj = $soap1->newobject();
      $soap1->method1($obj);

      but I would like to have this as
      =================================

      $obj->method1(); I dont want to specifiy $soap1 in
      each and every value like $soap1->method1($obj);


      AutoDispatch Model:
      ===================

      use SOAP::Lite +autodispatch =>
      uri => 'urn:/My/Examples',
      proxy => 'http://localhost/';

      $obj = newobject();
      $obj -> method1();

      But How can I use this to work with multiple server.
      Is it possible to create AutoDispatch soap objects?!!

      like

      $obj1 = $soap1->newobject(); # for server 1 calls
      $obj1->method1();

      $obj2 = $soap2->newobject(); # for server 2 (differnt URL/Proxy)calls
      $obj2->method1();

      Its looks like combining autodispatch and the normal method.

      Thanks,
      Nagarajan


      --- In soaplite@yahoogroups.com, "Randy J. Ray" <rjray@b...> wrote:
      > naga_cit wrote:
      > >
      > > Hi All,
      > >
      > > Is there a way I can switch between two servers in autodispatch
      with
      > > in a same script.
      >
      > You can call the proxy() method as a static method to set a new
      URL:
      >
      > SOAP::Lite->proxy($new_url);
      >
      > That should apply to the internal object that autodispatch uses.
      If the new URL
      > uses the same scheme as before (both are http, for example), you
      can just
      > change the endpoint itself:
      >
      > SOAP::Lite->endpoint($new_url);
      >
      > Note that this will *not* work if old URL is http, and new URL is
      https. These
      > are different protocols as far as SOAP::Lite is concerned.
      >
      > Randy
      > --
      > rjray@b... http://www.rjray.org
      http://www.svsm.org
      >
      > We will never have true civilization until we have learned to
      recognize the
      > rights of others.-- Will Rogers
    • Show all 3 messages in this topic