[Xml-compile] Problem when returning data from handler: Can't call method "wasFatal"

Robin V. robinsp at gmail.com
Tue Mar 16 10:51:03 GMT 2010


Solving problems after problems, I come before you with a new one today...

Now that the server is up and running (on unix as I haven't solved the
win32 problem yet), there are problems when I try to return response
from the callback. The error message come from compileHandler:

CONNECT TCP Peer: "10.97.52.129:46739" Local: "10.97.52.129:8889"
procedure CheckStatus selected
call data not used: CheckStatusResponse
 at /usr/local/share/perl/5.10.0/XML/Compile/SOAP.pm line 153
connection ended with force; Can't call method "wasFatal" without a
package or object reference at
/usr/local/share/perl/5.10.0/XML/Compile/SOAP/Server.pm line 81.

I don't know if the problem is that I once again badly use the API
(maybe operationsFromWSDL isn't enough and i have to manually use
compileHandler and compileMessage?) or if the way I construct the
reply is wrong, but whatever the problem is, I'm again in a dead end
:-/

The script looks like this:
==================
my $wsdl = XML::Compile::WSDL11->new($wsdlfile);
$wsdl->importDefinitions('siri.xsd');

my $daemon = XML::Compile::SOAP::HTTPDaemon->new(based_on =>
'Net::Server::PreFork');
 sub my_callback()
 {   my ($soap, $data_in) = @_;
	{ CheckStatusResponse => {
		Answer => {
			Status => 'true'
		}
         }
}

$daemon->operationsFromWSDL($wsdl,
    default_callback => \&my_callback,
    callbacks => { CheckStatus => \&my_callback } );	

$daemon->run( port => 8889 );

I tried several different ways to return the data, like not using
CheckStatusResponse (in case the first level was handled by the
stack). I also tried things like this:

my %answer;
$answer{Answer}{Status} = 'true';
# or $answer{CheckStatusResponse}{Answer}{Status} = 'true';
return \%answer;

or
my $answer;
$answer->{Answer}->{Status} = 'true';
# or $answer->{CheckStatusResponse}->{Answer}->{Status} = 'true';
return $anwser;

But the error is always the same...

I think I miss some kind of idiot guide to xml::compile :-/

Regards,
Robin



More information about the Xml-compile mailing list