<?xml version="1.0" encoding="windows-1252"?>
<node id="652301" title="Re^3: SOAP::Transport::HTTP::Daemon and XML" created="2007-11-21 23:05:55" updated="2007-11-21 18:05:55">
<type id="11">
note</type>
<author id="129551">
erroneousBollock</author>
<data>
<field name="doctext">
&lt;blockquote&gt;I have the WSDL description, but only in file form.&lt;/blockquote&gt;
Are you sure?&lt;p&gt;

Web-services commonly serve their WSDL from the proxy URL with '?WSDL' appended.&lt;p&gt;

The [http://search.cpan.org/~byrne/SOAP-Lite-0.69/lib/OldDocs/SOAP/Transport/HTTP.pm|SOAP::Transport::HTTP::Server] subclasses don't make it easy to serve your WSDL from the same service, so what I do is the following: &lt;ol&gt;
  &lt;li&gt;use the &lt;c&gt;HTTP::Request-&gt;parse&lt;/c&gt; constructor from [mod://HTTP::Request] to build a request from the raw incoming request, then&lt;/li&gt;
  &lt;li&gt;(depending on the $request-&gt;uri) I either:&lt;ul&gt;
    &lt;li&gt;build a response containing WSDL, or&lt;/li&gt;
    &lt;li&gt;pass $request directly to SOAP::Transport::HTTP::Server like this:&lt;p&gt;&lt;code&gt;
     my $soap = SOAP::Transport::HTTP::Server
	    -&gt; new(%args) 
	    -&gt; dispatch_to(@classes);
     $soap-&gt;request($request);
     $soap-&gt;handle;
     my $response = $soap-&gt;response;
    &lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
  &lt;/ul&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
Is it necessary that &lt;c&gt;WSDL&lt;/c&gt; file be web served?  I don't see how to use it as local file, is it possible?
&lt;/blockquote&gt;
Sure, do something like this:&lt;p&gt;
&lt;code&gt;
my $soap = SOAP::WSDL-&gt;new();
$soap-&gt;wsdl('file:/path/to/file.wsdl'); 
$soap-&gt;proxy('http://server/service.cgi');
$soap-&gt;wsdlinit(caching =&gt; 1);
&lt;/code&gt;
Loading from the file saves some time on script startup, using caching saves a lot of work on each request.&lt;p&gt;

&lt;b&gt;Update: &lt;/b&gt; Fixed my URLs.&lt;p&gt;

-David
</field>
<field name="root_node">
652291</field>
<field name="parent_node">
652299</field>
</data>
</node>
