[Xml-compile] parsing SOAP Faults
Gert Doering
gert at space.net
Wed Dec 18 14:19:10 GMT 2013
Hi,
On Wed, Dec 18, 2013 at 03:01:16PM +0100, Mark Overmeer wrote:
> * Gert Doering (gert at space.net) [131218 13:33]:
> > This is what I get back via https (Dumper($trace)):
>
> The $trace is nice object, the facts are more readible if you call
>
> $trace->printErrors;
> $trace->printRequest(pretty_print => 1);
> $trace->printResponse(pretty_print => 1);
>
> It seems like a normal login failure (user unknown), correctly
> returned to your application.
Well, I would have expected to see the fault in $answer->{Fault}, but
$answer is undef.
I *like* reporting faultstrings, but that depends on being returned
them :-)
> Do you check the call?
>
> my ($answer, $trace) = $wsdl->call($operation => %args);
This is how my call looks like. $answer is undef, so I look at $trace.
> if($trace->errors)
> { $trace->printError;
> # or
> # print for $trace->errors;
> }
Didn't know about $trace->error, but it's not enlightening me much more,
as I already knew that it's unhappy about decoding, but can't see a reason
why this is so...
error: decode error: cannot find element or attribute `{http://xml.apache.org/axis/}hostname'
... and neither is $trace->printErrors ...
Errors while decoding:
error: decode error: cannot find element or attribute `{http://xml.apache.org/axis/}hostname'
My application uses $answer->{Fault}->{faultstring} to report specifically
what went wrong, and that normally *works* - here it doesn't, and I try
to find out why. "Just give up if $answer is empty or $trace->errors is
set" is not good enough, as different faultstrings need to be handled
differently - there's certain faultcodes in the application that warrant
re-trying a few minutes later, and others are "fatal" (like this one),
but should still be reported.
Pointing at the SOAP Response again:
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode xmlns:ns1="http://www.telefoncia.de/kts">ns1:10002</faultcode><faultstring>ARERR [10002] Could not transmit data to TDe (See Error Queue for detailed information). (User \'XXXXX\' not found)</faultstring><detail><ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">solr-663</ns2:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
... there is a "<hostname>" inside here, and it seems to have the right
namespace as well, so why is it erroring?
Gert Doering
-- NetMaster
--
have you enabled IPv6 on something today...?
SpaceNet AG Vorstand: Sebastian v. Bomhard
Joseph-Dollinger-Bogen 14 Aufsichtsratsvors.: A. Grundner-Culemann
D-80807 Muenchen HRB: 136055 (AG Muenchen)
Tel: +49 (0)89/32356-444 USt-IdNr.: DE813185279
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 826 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20131218/e50b1b59/attachment.pgp
More information about the Xml-compile
mailing list