cormanaz has asked for the wisdom of the Perl Monks concerning the following question:

On the advice of a wise monk I read-up on SOAP and wrote a server to take a datastructure from a db running on a Windoze machine on DHCP and transfer it to a db on an ISP website running on linux. It worked great and code clips are here if anyone is interested.

Now I am wondering how I can go the other way, e.g. have that web site send something back to the Windoze machine to do some processing that is not possible on the ISP server. I figure I can use a nameserver to find the machine behind DHCP. However I'm not completely sure how to apply SOAP to implement the server I need.

I found an example of an HTTP Daemon using SOAP at http://www.perl.com/pub/a/2001/04/24/soap.html but I don't know if this is exactly what I need. I don't want to serve files so much as run callback subroutines, and then and return results to the client. I'm also not sure of the best protocol to use, either.

Can anyone point me to sample code or advise me on general approach for this? To be clear, I want to generate a datastructure on the client side, send it to the server, have processing done, and have the results returned as a different datastructure.

Many thanks....Steve

Replies are listed 'Best First'.
Re: SOAP web client to server behind DHCP
by jhourcle (Prior) on Dec 22, 2005 at 16:43 UTC

    You can either use a stand-alone daemon, an apache install, or any other webserver -- that part's mostly just a matter of personal preference.

    From the sounds of things, you already have dynamic DNS, so you don't have to worry about some complicated system where the client notifies the server when it's moved.

    Anyway, the code you found should do exactly what you're looking for -- it'll bind to port 80, and listen for connections, then dispatch to the appropriate modules, based on the URI used in the SOAP connection. There's a little more info on the soaplite website, but they don't have the 'writing a server' bit done, just bits on how to modify the behavior of the responses.

    The only thing I can think of is to take a look at the documentation for SOAP::Transport::HTTP, within the SOAP::Lite package. I've never used the SOAP::Transport::HTTP::Daemon, but I think I remember having seen a note about it processing requests in serial, as opposed to forking children (test it, and make sure it works for what you're trying to do)