I apologize in advance for such a long post!

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.

If I put back the 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. :-)


my $wsdl = XML::Compile::WSDL11->new($xml);
my $client = $wsdl->compileClient($message,
port => $message.'Port', transport_hook => \&proxy_to_test_app,
# $params is the monster data structure to be sent
$params->{PackageRequest}{DateRange} = {Duration => 'P7N'}; # testing
lack of Start element
($answer, $trace) = $client->( { body => $params } );

error: no applicable choice for `Success' at {http://www.opentravel.org/OTA/2003/05

[debug] Outgoing XML:
<SOAPENV:Envelope xmlns:SOAPENV="http://schemas.xmlsoap.org/soap/envelope/
<x0:TTI_PkgBookRS xmlns:x0="http://www.opentravel.org/OTA/2003/05
" Version="1">
<x0:Warning Type="3" ShortText="Missing or invalid
booking start date: []" Code="145"/>
<x0:Source AgentSine="root" AgentDutyCode="abc123">
<x0:RequestorID Type="4" ID="1234"/>
<x0:UniqueID Type="11" ID="WARNING1208880522"/>
<x0:Package ID="S08/2009-02-14/14" ProductCode="SKI">
<x0:DateRange Duration="P7N"/>
<x0:PassengerListItem Code="10" RPH="2"
<x0:PassengerListItem Code="10" RPH="1"
BirthDate="1974-04-20" LeadPaxInd="1">
<x0:GrossAmount Amount="1234.000"/>
<x0:DepositAmount Amount="0.000"/>
<x0:AgentCommission Amount="0.000"/>
<x0:NetAmount Amount="1234.000"/>
<x0:BalanceDueAmount Amount="1234.000"

Schema for message:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Amended 25Jun07 to correct it to OTA2004A -->
<xs:schema targetNamespace="http://www.opentravel.org/OTA/2003/05"
xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xs="http://www.w3.org/2001/XMLSchema
" elementFormDefault="qualified" version="1.0" id="OTA2004A">
<xs:include schemaLocation="TTI_PkgReservation.xsd"/>
<xs:element name="TTI_PkgBookRS">
<xs:element name="Success" type="SuccessType"/>
<xs:element name="Warnings" type="WarningsType" minOccurs="0"/>
<xs:element name="PackageReservation" type="PkgReservation"/>
<xs:element name="Errors" type="ErrorsType"/>
<xs:attributeGroup ref="OTA_PayloadStdAttributes"/>
<xs:attributeGroup ref="CurrencyCodeGroup"/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20080422/352cb9f7/attachment-0001.htm

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
groupxml-compile @
postedApr 22, '08 at 5:23p
activeApr 22, '08 at 6:22p

2 users in discussion

Drew Taylor: 2 posts Mark Overmeer: 1 post



site design / logo © 2022 Grokbase