<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><html>On 22 Apr 2008, at 17:23, Drew Taylor wrote:</html><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I apologize in advance for such a long post!<div><br></div><div>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). The incoming and outgoing SOAP messages are below. In this particular case, I'm leaving off PackageRequest/DateRange/Start to test my error checking. I can see the warning message in the response, so that part is working correctly. However, the client gives me an error when trying to read in the response and parse it.</div><div><br></div><div>If I put back the&nbsp;PackageRequest/DateRange/Start element everything works fine. There must be something simple I'm overlooking... It seems crazy that I can't test failure scenarios because X::C is saving me from my (intentional) errors. :-)</div><div><br></div><div>Drew</div><div><br></div><div>Client:</div><div><div>my $wsdl &nbsp; &nbsp;= XML::Compile::WSDL11->new($xml);</div><div>my $client &nbsp;= $wsdl->compileClient($message,&nbsp;</div><div>&nbsp;&nbsp; &nbsp;port => $message.'Port', transport_hook => \&amp;proxy_to_test_app,</div><div>);</div><div># $params is the monster data structure to be sent</div><div>$params->{PackageRequest}{DateRange} = {Duration => 'P7N'}; # testing lack of Start element</div></div><div>($answer, $trace) = $client->( { body => $params } );</div><div><br></div><div>Gives:</div><div>&nbsp;&nbsp;error: no applicable choice for `Success' at {<a href="http://www.opentravel.org/OTA/2003/05">http://www.opentravel.org/OTA/2003/05</a>}TTI_PkgBookRS</div></div></blockquote><br></div><div>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.</div><div><br></div><div>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? And how did this pass the server-side check? I thought it was more stringent about these things? On my side, I'll dig into the schemas and see if Accommodation was required or optional and any other relevant bits.</div><div><br></div><div>Drew</div></body></html>