[Xml-compile] Logging and WSDL url
Mark Overmeer
mark at overmeer.net
Tue Nov 19 13:14:21 GMT 2013
* Kieron Johnson (ao7one at gmail.com) [131119 12:54]:
> 1. Logging - I’d like to log all attempts to access the service whether
> successful or not. So I’ve added log_file and log_level but whilst it
> provides decent logging on start up it doesn’t appear to log any client
> connectivity at all. How might I achieve this?
>
> use Log::Report syntax => 'SHORT';
"syntax => 'SHORT'" is default, nowadays.
> my $daemon = XML::Compile::SOAP::Daemon::NetServer->new();
> $daemon->run
> ( ...
> , log_file => 'Log::Log4Perl'
> , log_level => 4
Ah, confusing! This controls the logging by the daemon, but does not
collect the logging of the application. The XML::Compile errors are
not directed towards this. (The ::AnyDaemon implementation naturally
merges the two, because that one also uses Log::Report)
To collect the logs from all modules which were build using Log::Report,
you do this in the main of your application:
dispatcher 'Log::Report::Dispatcher::Log4perl', 'default'
, config => $l4p_config_file;
This dispatcher will have name "default", and implies closing the
existing dispatcher named "default" which sends the output to the
screen.
This week, for an other project, I rewrote this dispatcher... but had
no chance to test it yet. You may try it, find it attached.
> 2. My devs are complaining that the URL for the WSDL doesn’t display in a
> browser but instead forces them to download it. Entering the URL into a
> browser it automatically adds ‘/’. eg: http://myserver.net:38385?WSDLbecomes
> http://myserver.net:38385/?WSDL This is apparently abnormal behaviour. Is
> there a way within either the xsd, WSDL or the server.pl to change that
> characteristic? My code is basically the standard example server.pl from
> the CPAN tar ball examples with my server side functions.
This probably has to do the the mime-type on the returned WSDL. The
browser is configured what to do with certain received mime-type. If
the type is unknown, it asks you what to do.
The response is created in lib/XML/Compile/SOAP/Daemon/LWPutil.pm
sub lwp_wsdl_response with content-type
Content-Type" => 'application/wsdl+xml; charset="utf-8"
I believe that the type is correct.
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark at Overmeer.net solutions at overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log4perl.pm
Type: application/x-perl
Size: 5882 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20131119/4d97eaa4/Log4perl.bin
More information about the Xml-compile
mailing list