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

Re: [soaplite] Changing endpoint from a full wsdl file

Expand Messages
  • Paul Kulchenko
    Hi Weidong, Randy is right. if WSDL doesn t include an endpoint, then manual call will make the trick: my $service = SOAP::Lite -
    Message 1 of 4 , Sep 27, 2002
    • 0 Attachment
      Hi Weidong,

      Randy is right. if WSDL doesn't include an endpoint, then manual call
      will make the trick:

      my $service = SOAP::Lite
      ->
      service('http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl');

      $service->proxy('http://foo/'); # <<<
      print $service->getQuote('MSFT'), "\n";

      If WSDL includes the endpoint, you can overwrite the endpoint()
      method to return the endpoint you want:

      sub SOAP::Lite::endpoint { return shift if @_ > 1; 'http://foo/' }

      That's the shortest solution I can come up with. Let me know if it
      doesn't work for you.

      Best wishes, Paul.

      --- "Randy J. Ray" <rjray@...> wrote:
      > On 2002.09.27 16:02 Weidong Wang wrote:
      > > I need to write client code that uses a wsdl file to start
      > talking to a
      > > server. The response from the server will carry new post URI for
      > the next
      > > call to post to. For example, the WSDL gives the following
      > endpoint:
      > >
      > > http://temp.org/soap
      > >
      > > and the response contains a link http://temp.org/soap/accounts
      > and this is
      > > the URI I need to post to.
      >
      > The problem is that the WSDL parsing code creates wrapper routines
      > for each of
      > the operations defined in the WSDL file. These wrappers explicitly
      > set the URI
      > before making the call, from within the wrappers themselves. So
      > manually
      > setting the URI is lost. And I can't offer a solution that wouldn't
      > involve a
      > big hack to SOAP::Lite, which I lack the time for at this point
      > :-). Sorry.
      >
      > Randy
      > --
      > rjray@... Linux: Because rebooting is for adding
      > new hardware.
      >
      > Any spammers auto-extracting addresses from this message will
      > definitely want
      > to include uce@... and report@...
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > 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!?
      New DSL Internet Access from SBC & Yahoo!
      http://sbc.yahoo.com
    • Weidong Wang
      Thanks, Paul and Randy. ... Paul, I tried it. I can put it anywhere in my code or library. When running, Perl will complain that SOAP::Lite::endpoint is
      Message 2 of 4 , Sep 28, 2002
      • 0 Attachment
        Thanks, Paul and Randy.

        > If WSDL includes the endpoint, you can overwrite the endpoint()
        > method to return the endpoint you want:
        >
        > sub SOAP::Lite::endpoint { return shift if @_ > 1; 'http://foo/' }
        >
        > That's the shortest solution I can come up with. Let me know if it
        > doesn't work for you.

        Paul, I tried it. I can put it anywhere in my code or library. When running, Perl will complain that SOAP::Lite::endpoint is redefined, but then it will use the new endpoint in this call.

        But it seems to me that having this sub will affect all WSDL calls, correct? In my app, I need to use multiple WSDL files for making different service calls. I suppose the existence of this sub will make all wrapper functions generated by service() call to use the new endpoint.

        It seesm to me if we can dynamically redefine this sub as needed and rerun service() call (much more overhead of course), we might be able to get around it?

        I will look into having the tModel kind of WSDL file.

        Thanks.

        Weidong
      Your message has been successfully submitted and would be delivered to recipients shortly.