[Xml-compile] How to debug schema problems
Mark Overmeer
mark at overmeer.net
Sun Apr 7 19:37:54 GMT 2013
* Uwe Voelker (uwe at uwevoelker.de) [130407 09:02]:
> I'm using XML::Compile::WSDL11 to access a webservice. It is working fine
> for a lot of the calls. But one call returns:
> error: element `...' not processed at ...
>
> I'm guessing this is an error in the schema, as I already fixed two other
> mistakes. But I have a very hard time to find this. It occurs in a
> complexType. What can I do to better locate this error?
That's a very difficult problem, in general. It is either a problem
with the element which is not processed, or the one before it.
Features like repetition, optional, choices and substitutionGroups
are really hiding the real cause of the mis-match. For instance,
when there is a choice between 4 complex elements, and one of those
should actually match but fails somewhere 4 levels deep in that
alternative, then the failure on the choice level fails.
> Do you have any suggestions for me?
When the problem is 'deep', then it is caught by a try() in choice
or substitutionGroups. Example:
my @d = try { $specials{$_}->($tree) };
next if $@;
It may help to add: warn $@ if $@; inbetween.
> How can I feed the XML I got from the server as file/string into
> XML::Compile? So I could edit the XML and the schema and maybe narrow the
> error down.
Narrowing down without invalidating the message is often hard. It requires
a lot of knowledge from the schema. Examples how to test returns
locally can be found in the test-scripts of the distribution, for instance
t/50wsdl.t (fake_server)
You may also produce a template $wsdl->template(XML => $type)
and the manually match the produced example with the message you have
recieved.
> PS: Unfortunately the schema is not public, otherwise I would have given
> you a complete example. Sorry.
You may send it off-list.
--
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