Excellent, so you have a working HTTPS server. (You can put it on whatever port you wish... 443 is just a convention.)

Now, you don't want to be changing SOAP or SOAP::Lite for deployment, so the trick is to invert control;
instead of SOAP::Lite calling HTTP::Daemon, you create a one-shot HTTP::Request handler around SOAP::Lite, and have that handle the request passed to it by HTTP::Daemon::SSL.

So inside your pre-existing HTTP::Daemon::SSL loop...
(where you'd normally parse the HTTP request and construct some HTTP response)
... firstly, construct an HTTP::Request object:

# I usually molest $raw_request_string a little here... my $request = HTTP::Request->parse($raw_request_string);
create a one-off soap handler:
my $soap = SOAP::Transport::HTTP::Server -> new(YOUR_SOAP_SPECIFIC_ARGS) -> dispatch_to(YOUR_CLASS);
then feed the request object to the soap handler:
# and I usually munge headers/SOAPaction here... $soap->request($request);
dispatch the request to your class via SOAP::Lite:
$soap->handle();
finally, pull out the response it built:
my $response = $soap->response;
As I implied earlier in this thread, doing it this way gives you more control over the HTTP request life-cycle... which means you can serve more than just SOAP rpc's from the service.

As an example, you can inspect the request (say before constructing the HTTP::Request object) and determine (based on the URI) whether you want to respond as SOAP rpc, respond with WSDL describing the service, or even respond with HTML explaining how to use the service.

(In my webservice framework I do all those, plus JSONRPC and some dynamic web content.)

-David


In reply to Re^9: Soap::lite - https ? by erroneousBollock
in thread Soap::lite - https ? by ethrbunny

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.