[Xml-compile] Fault when required child within optional parent node
Mark Overmeer
mark at overmeer.net
Sat Aug 19 10:13:51 GMT 2017
* Thibadeau, Daniel (dan.thibadeau at hp.com) [170819 04:29]:
> error: decode error: data for element or block starting with `amount_collect' missing at tns:calculateTaxOnCteDataModelResponse/return/cte_document/document_header/payment_information
>
> My request does not contain the "payment_information" element, so the
> response is also missing that element (as expected). The fault message
> seems to only be on the response and not the request.
Yes, decoding is performed on the received message. Also, the element
named *Response.
> I believe this should be a valid WSDL configuration. I do get back a
> valid/expected response in $answer
I expect that the response contains an empty <payment_information/> But
it may also be not empty with an unexpected or out-of-order field.
See $trace->printResponse(pretty_print => 1);
> What can I do to prevent the error?
Fix the schema or server ;-)
> Should the printErrors() method be printing the error twice?
The first error is only the last (fatal) issue. After that, it lists
all issues, sometimes with more information.
--
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