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

non-qualified method calls in XMLRPC::Lite server?

Expand Messages
  • al_shenkin
    Hi Folks, I ve been asked by a client to implement an xmlrpc call on my server: ourMethod However, for obvious reasons, i can t just
    Message 1 of 3 , Apr 12 4:29 PM
    • 0 Attachment
      Hi Folks,
      I've been asked by a client to implement an xmlrpc call on my server:

      <methodName>ourMethod</methodName>

      However, for obvious reasons, i can't just have "methodName" sitting available in the main namespace.

      I'm running apache, and have been using XMLRPC::Lite servers via a perl-script handler.

      Is there an easy way to implement this method without having the client rewrite their calls? I'd rather not ask the client to rewrite their calls to something like:

      <methodName>path.to.local.lib.ourMethod</methodName>

      even if i changed the PERL5LIB, i'd still have to have:

      <methodName>package.ourMethod</methodName>

      I suppose i could have a cgi script act as a proxy and rewrite the XMLRPC calls, but this seems a hackish. Any more elegant ideas?

      tia,
      alex
    • askbjoernhansen <ask@develooper.com>
      ... available in the main namespace. ... perl-script handler. ... client rewrite their calls? I d rather not ask the client to rewrite ... I don t see a reply
      Message 2 of 3 , Jan 6, 2003
      • 0 Attachment
        --- In soaplite@yahoogroups.com, "al_shenkin" <ashenkin@q...> wrote:
        > Hi Folks,
        > I've been asked by a client to implement an xmlrpc call on my server:
        >
        > <methodName>ourMethod</methodName>
        >
        > However, for obvious reasons, i can't just have "methodName" sitting
        available in the main namespace.
        >
        > I'm running apache, and have been using XMLRPC::Lite servers via a
        perl-script handler.
        >
        > Is there an easy way to implement this method without having the
        client rewrite their calls? I'd rather not ask the client to rewrite
        their calls to something like:
        >

        I don't see a reply to this in the archives. I am interested in the
        same thing. In my system the proxy is already specifying the internal
        namespace; all methods are mapped into one package. How can I get the
        clients to use 'method' instead of 'Package.method'?


        - ask

        --
        http://www.askbjoernhansen.com/
      • Paul Kulchenko
        ... You should be able to do that using dispatch_with method: my $daemon = XMLRPC::Transport::HTTP::Daemon - dispatch_to( Foo ) - dispatch_with({undef,
        Message 3 of 3 , Jan 6, 2003
        • 0 Attachment
          > namespace; all methods are mapped into one package. How can I get
          > the clients to use 'method' instead of 'Package.method'?

          You should be able to do that using dispatch_with method:

          my $daemon = XMLRPC::Transport::HTTP::Daemon
          -> dispatch_to('Foo')
          -> dispatch_with({undef, 'Foo'})
          # redirect all calls from package 'main' to package 'Foo'
          ;

          You can also use ->dispatch_with({Bar => 'Foo'}) to do the same trick
          for other packages.

          Best wishes, Paul.

          P.S. If that doesn't work for some reason, you should be able to do
          that using on_dispatch method:

          my $daemon = XMLRPC::Transport::HTTP::Daemon
          -> dispatch_to('MyPackage')
          -> on_dispatch(sub{return MyPackage => shift->method})
          ;

          This code will resolve 'foo' as 'MyPackage::foo'. A little bit more
          logic will allow to map any other package too:

          -> on_dispatch(sub{
          my $method = shift->method;
          $method = s/.*\.//; # remove package name
          return MyPackage => $method;
          })

          --- "askbjoernhansen <ask@...>" <ask@...>
          wrote:
          > --- In soaplite@yahoogroups.com, "al_shenkin" <ashenkin@q...>
          > wrote:
          > > Hi Folks,
          > > I've been asked by a client to implement an xmlrpc call on my
          > server:
          > >
          > > <methodName>ourMethod</methodName>
          > >
          > > However, for obvious reasons, i can't just have "methodName"
          > sitting
          > available in the main namespace.
          > >
          > > I'm running apache, and have been using XMLRPC::Lite servers via
          > a
          > perl-script handler.
          > >
          > > Is there an easy way to implement this method without having the
          > client rewrite their calls? I'd rather not ask the client to
          > rewrite
          > their calls to something like:
          > >
          >
          > I don't see a reply to this in the archives. I am interested in
          > the
          > same thing. In my system the proxy is already specifying the
          > internal
          > namespace; all methods are mapped into one package. How can I get
          > the
          > clients to use 'method' instead of 'Package.method'?
          >
          >
          > - ask
          >
          > --
          > http://www.askbjoernhansen.com/
          >
          >
          > ------------------------ 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!?
          Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
          http://mailplus.yahoo.com
        Your message has been successfully submitted and would be delivered to recipients shortly.