[Xml-compile] parsing SOAP Faults

Mark Overmeer mark at overmeer.net
Wed Dec 18 14:31:35 GMT 2013


* Gert Doering (gert at space.net) [131218 14:19]:
> Well, I would have expected to see the fault in $answer->{Fault}, but
> $answer is undef.

The $answer is always only the information which is contained in the
response.  If there is no valid SOAP response, for instance because the
the request could not be sent, or the response cannot be decoded (as
in this case), then the $answer is empty.

Still, the $trace can tell you more.  $trace->errors returns both errors
in the processing locally as errors (faults) reported by the server.

> 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.

Yes, that will give you the server side error, as it is encoded in the
response.  I must update the documentation, because ::Trace grew more
powerful over time.

> ... there is a "<hostname>" inside here, and it seems to have the right
> namespace as well, so why is it erroring?

So: the error is that the $wsdl->reader('ns2:hostname') cannot be created
(I think at compile-time).  Can you check the schema that the element
does exist?
-- 
Regards,

               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list