[Xml-compile] Logging and WSDL url

Kieron Johnson ao7one at gmail.com
Wed Nov 20 22:47:25 GMT 2013


Thank you very much for the response.

Yes that is confusing! I've made the change and actually prefer Log4Perl -
seems more flexible and configurable without being complex. It works well
and I can now happily track incoming requests within the with the following
code within the server side subs for the operations (in this case
"RequestMachine"):

notice __x "RequestMachine received request ID {request} for host
{hostname} from {called}",

            request =3D> $RequestID,

            hostname =3D> $HostName,

            called =3D> $daemon->{server}{peeraddr} ;


but I am still struggling to work out how to log for all connectivity. For
example I'd like to know when someone has attempted to download the WSDL
and I cannot see any mechanism to do that though I guess I need to capture
it within Net::Server ?


Thank you for the comment about the mime-type - that enable me to track it
down to a browser config issue.


Cheers


On Tue, Nov 19, 2013 at 1:14 PM, Mark Overmeer <mark at overmeer.net> wrote:

> * Kieron Johnson (ao7one at gmail.com) [131119 12:54]:
> > 1. Logging -  I=92d like to log all attempts to access the service whet=
her
> > successful or not. So I=92ve added log_file and log_level but whilst it
> > provides decent logging on start up it doesn=92t appear to log any clie=
nt
> > connectivity at all. How might I achieve this?
> >
> > use Log::Report   syntax =3D> 'SHORT';
>
> "syntax =3D> 'SHORT'" is default, nowadays.
>
> > my $daemon =3D XML::Compile::SOAP::Daemon::NetServer->new();
> > $daemon->run
> >   ( ...
> >   , log_file    =3D> 'Log::Log4Perl'
> >   , log_level   =3D>  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 =3D> $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=92t display =
in a
> > browser but instead forces them to download it. Entering the URL into a
> > browser it automatically adds =91/=92. 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" =3D> 'application/wsdl+xml; charset=3D"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 --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20131120/13=
457c0c/attachment.htm


More information about the Xml-compile mailing list