[Xml-compile] Problem with choice

Mark Overmeer mark at overmeer.net
Tue Apr 22 18:22:43 BST 2008


* Drew Taylor (drew at drewtaylor.com) [080422 17:08]:
>    I'm having an issue with an end-to-end test which is testing for errors in
>    messages. Using X::C::WSDL, I create a client and send off a request to the
>    server (it's Catalyst but I don't think that's relevant).

>      error: no applicable choice for `Success' at
>    {[1]http://www.opentravel.org/OTA/2003/05}TTI_PkgBookRS

>    So I guess the real question is: why was the client telling me that it was
>    having a problem finding a choice for the wrong element?

The problem with "Choice" with complex components (like your sequences),
is that all choices must attempted.  When all fail, each block can have
a different reason why it fails.

>    OK, I figured it out. :-) Turns out the response was NOT valid according to
>    the schema. It was missing a required element "Accommodation" deep down in
>    PackageReservation/Package/ItineraryItems/ItineraryItem.

Add this to the top of your script, to get some extra debug information:

  use Log::Report mode => 'DEBUG';   # or:    mode => 3

and you would probably have seen this problem.  I am putting some extra
"trace" messages in the compilation and run-time, as long as they do not
delay the normal message processing.  Suggestions welcome.
-- 
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