Hi Eugenio,
The proper way to throw a exception is just to die -
SOAP::WSDL::Server::CGI catches the exception and sends a SOAP Fault
back to the client.
If you want more control over the SOAP Fault sent to the client, you can
die with a SOAP::WSDL::SOAP::Fault11 object - or just let the
SOAP::Server's deserializer create one for you:
my $soap = MyServer::SomeService->new();
die $soap->get_deserializer()->generate_fault({
code => 'soap:Server',
role => 'urn:localhost',
message =>; "The error message to pas back",
detail => "Some details on the error",
});
You may use any other object as exception, provided it has a
serialize() method which returns the object's XML representation.
|