[Xml-compile] Logging from callback
Robin V.
robinsp at gmail.com
Fri Apr 23 22:13:04 GMT 2010
>> In fact, I'm not a perl guru
>
> You'll become one soon ;-)
The day I'll understand all your code I'll feel like it, but today, it
just make me feel dumb :)
> Bigger libraries need some exception handling facilities, and Perl
> does not offer een standard system... so there are at least five of
> them. This is certainly problematic. Log::Report is able to pass
> reports to two of the other, to enable integration.
Having a choice is good, but sometimes, I feel that these multiple
variants to do the same thing is a drawback. Whatever I learn, It
seems that I still have to learn something new. And when you're a
casual perl programmer, the learning curve is sometimes so heavy that
it isn't worth working with perl. (that's the way I feel with my small
prototype, would I have started with Java, I think I would have
already finished it :-/ ).
>> For some unknown reason, I didn't managed to see anything from the
>> 'PERL' backend where logs outside the callback were working, but not
>> the logs from the callback itself. With the 'FILE' backend, I managed
>> to write logs, but the file writing was buffered until closing which
>> was useless for debugging puropse.
>
> Ok, that's an omission. Log/Report/Dispatcher/File.pm
>
> my $binmode = $args->{replace} ? '>' : '>>';
>
> $self->{output} = IO::File->new($to, $binmode)
> or fault __x"cannot write log into {file} with {binmode}"
> , binmode => $binmode, file => $to;
> + $self->{output}->autoflush;
>
> I will also extend the docs about that a little.
This patch works perfectly. I now use Log::Report with the File
backend and everything is working. Once again, many many thanks for
your help!
It's not something mandatory, but I would have liked to issue a real
fault message for unimplemented services of the wsdl. The docs are
clear on how to return fault and I managed to return a simple fault,
but I'd like to return a complex fault (with detail). Is this possible
with x:c ?
I don't see how to do this in
http://search.cpan.org/~markov/XML-Compile-SOAP-Daemon-2.02/lib/XML/Compile/SOAP/Daemon.pod
Should I return something like:
{
SiriError => {
faultcode => 111,
faultstring => 'not implemented',
faultactor => 'who mom likes',
OtherError => {
ErrorText => 'Mistake'
},
Description => 'ARRRG'
}
Or something like
{
Fault =>
{ faultcode => 111
, faultstring => 'not implemented'
, faultactor => 'who mom likes',
SiriError => {
OtherError => {
ErrorText => 'Mistake'
},
Description => 'ARRRG'
}
}
Or should I use somewhere the standard soap xml element 'detail' ?
As usual... any help is appreciated :).
Many thanks again,
Robin
More information about the Xml-compile
mailing list