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

Re: [soaplite] daemon server dispatch to problem

Expand Messages
  • Duncan Cameron
    ... The MIME::Tools required is 6.200 or later. You will need that if you want to send attachments. I have got SOAP::Lite working against Axis, on W2000
    Message 1 of 2 , Feb 16, 2005
    • 0 Attachment
      On 2005-02-16 at 18:33:05 Gary Shea wrote:

      >I've successfully written a simple SOAP::Lite client to an Axis
      >server,
      >fairly painless. Now I'm trying to write a functional test for that
      >client by kicking off a SOAP server and verifying that the client
      >contacts it, makes the right query, etc. The server doesn't seem to
      >be
      >paying any attention to my dispatch_to arguments.
      >
      >perl5.8.5 (with ithreads, installed from src on a Linux box)
      >MIME::Parser 5.417
      >SOAP::Lite 0.60
      >
      >I have been unable to get a clean install of SOAP::Lite (any version,
      >including 0.65x) but it seems to pretty much work. I wonder if
      >MIME-tools doesn't like ithreads? Also, Axis support calls for a
      >version of MIME-Tools which I have been unable to find anywhere.
      >Very
      >strange. I did find 6.200 but it wouldn't build properly either.

      The MIME::Tools required is 6.200 or later. You will need that if you
      want to send attachments. I have got SOAP::Lite working against Axis,
      on W2000 though.

      >I've been hacking around in the code and so far it appears that the
      >dispatch_to method default of sub {return} is never being replaced
      >with
      >something more... useful ;) However, I'm somewhat baffled by the
      >code
      >and haven't figured out where a more useful version of dispatch_to
      >would
      >come from.
      >
      > $self->{'daemon'} = SOAP::Transport::HTTP::Daemon
      > ->new(LocalAddr => 'localhost', LocalPort => 9191)
      > ->dispatch_to('ws::handlers::authenticate');
      > print "SOAP server (pid=$$) started at ",
      > $self->{'daemon'}->url, "\n";
      > $self->{'daemon'}->handle();
      >
      >The ws::handlers package is in the same file; the authenticate
      >method is
      >never called. Instead I get the
      >
      > "Failed to locate method ($method_name) in class ($class)"
      >
      >error in SOAP::Server::handler where $method_name is 'authenticate',
      >as
      >it should be, but $class == 'main'
      >
      >I could use a hint :)
      >
      As well as calling the 'authenticate' method, the client has to
      provide a SOAPAction that will map to ws::handlers. I would guess
      that the SOAPAction needs to be something like

      http://something/ws/handlers

      See the docs under SOAP::Transport::HTTP

      Good luck

      Duncan
    • Gary Shea
      Thanks for the hint! Starting with what you said, I managed to get the server test working. From the SOAP::Lite doc: You may use both dispatch_to() and
      Message 2 of 2 , Feb 16, 2005
      • 0 Attachment
        Thanks for the hint! Starting with what you said, I managed to get the
        server test working. From the SOAP::Lite doc:

        You may use both "dispatch_to()" and "dispatch_with()" syntax and
        "dispatch_with()" has more priority, so first checked URI, then
        SOAPAction and only then will be checked "dis-
        patch_to()".

        I wasn't setting a uri in the client, because when I did it prevented
        Axis from working, as Axis tried to use a class based on the uri, and I
        don't want the class and uri to match exactly. Temporarily ignoring
        that issue, I set a uri on the client, set dispatch_with to pair the uri
        with ws::handlers, and voila my test server works. Of course my Axis
        server doesn't work any more :)

        Now I just have to figure out the equivalent of dispatch_with for Axis.

        Thanks again!

        Gary

        On Wed, 2005-02-16 at 19:14 +0000, Duncan Cameron wrote:
        > On 2005-02-16 at 18:33:05 Gary Shea wrote:
        >
        > >I've successfully written a simple SOAP::Lite client to an Axis
        > >server,
        > >fairly painless. Now I'm trying to write a functional test for that
        > >client by kicking off a SOAP server and verifying that the client
        > >contacts it, makes the right query, etc. The server doesn't seem to
        > >be
        > >paying any attention to my dispatch_to arguments.
        > >
        > >perl5.8.5 (with ithreads, installed from src on a Linux box)
        > >MIME::Parser 5.417
        > >SOAP::Lite 0.60
        > >
        > >I have been unable to get a clean install of SOAP::Lite (any version,
        > >including 0.65x) but it seems to pretty much work. I wonder if
        > >MIME-tools doesn't like ithreads? Also, Axis support calls for a
        > >version of MIME-Tools which I have been unable to find anywhere.
        > >Very
        > >strange. I did find 6.200 but it wouldn't build properly either.
        >
        > The MIME::Tools required is 6.200 or later. You will need that if you
        > want to send attachments. I have got SOAP::Lite working against Axis,
        > on W2000 though.
        >
        > >I've been hacking around in the code and so far it appears that the
        > >dispatch_to method default of sub {return} is never being replaced
        > >with
        > >something more... useful ;) However, I'm somewhat baffled by the
        > >code
        > >and haven't figured out where a more useful version of dispatch_to
        > >would
        > >come from.
        > >
        > > $self->{'daemon'} = SOAP::Transport::HTTP::Daemon
        > > ->new(LocalAddr => 'localhost', LocalPort => 9191)
        > > ->dispatch_to('ws::handlers::authenticate');
        > > print "SOAP server (pid=$$) started at ",
        > > $self->{'daemon'}->url, "\n";
        > > $self->{'daemon'}->handle();
        > >
        > >The ws::handlers package is in the same file; the authenticate
        > >method is
        > >never called. Instead I get the
        > >
        > > "Failed to locate method ($method_name) in class ($class)"
        > >
        > >error in SOAP::Server::handler where $method_name is 'authenticate',
        > >as
        > >it should be, but $class == 'main'
        > >
        > >I could use a hint :)
        > >
        > As well as calling the 'authenticate' method, the client has to
        > provide a SOAPAction that will map to ws::handlers. I would guess
        > that the SOAPAction needs to be something like
        >
        > http://something/ws/handlers
        >
        > See the docs under SOAP::Transport::HTTP
        >
        > Good luck
        >
        > Duncan
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.