Hello, Here are two requests hitting our WS. The only differences are on "typing" each sub-element of the TruckEnqui element.
<?xml version="1.0" encoding="UTF-8"?> <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:Header/> <soap-env:Body> <ns0:truckEnqui xmlns:ns0="http://brittany-ferries.fr/TruckTrace"> <sClientAccountNo>F101012E</sClientAccountNo> <dDepartureDate>2003-01-15T00:00:00</dDepartureDate> <sSearchWithinFiveDays>Y</sSearchWithinFiveDays> <sRoute/> <sRegistrationNo/> </ns0:truckEnqui> </soap-env:Body> </soap-env:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Body> <ns0:truckEnqui xmlns:ns0="http://brittany-ferries.fr/TruckTrace"> <sClientAccountNo xsi:type="xsd:string">F101012E</sClientAccountNo> <dDepartureDate xsi:type="xsd:dateTime">2002-12-27T00:00:00</dDepartureDate> <sSearchWithinFiveDays xsi:type="xsd:string">Y</sSearchWithinFiveDays> <sRoute xsi:type="xsd:string"></sRoute> <sRegistrationNo xsi:type="xsd:string"> </sRegistrationNo> </ns0:truckEnqui> </SOAP-ENV:Body> </SOAP-ENV:Envelope> And the schema associated. <xs:schema targetNamespace="http://brittany-ferries.fr/TruckTrace" xmlns="http://brittany-ferries.fr/TruckTrace" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified"> <xs:element name="truckEnqui" type="TruckEnquiType"/> <xs:complexType name="TruckEnquiType"> <xs:sequence> <xs:element name="sClientAccountNo" type="xs:string" form="unqualified"/> <xs:element name="dDepartureDate" type="xs:dateTime" default="2002-11-13T00:00:00" form="unqualified"/> <xs:element name="sSearchWithinFiveDays" type="sSearchWithinFiveDaysType" default="N" form="unqualified"/> <xs:element name="sRoute" type="sRouteType" form="unqualified" nillable="true"/> <xs:element name="sRegistrationNo" type="xs:string" form="unqualified" nillable="true"/> </xs:sequence> </xs:complexType> <xs:simpleType name="sSearchWithinFiveDaysType"> <xs:restriction base="xs:string"> <xs:enumeration value=""/> <xs:enumeration value="Y"/> <xs:enumeration value="N"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="sRouteType"> <xs:restriction base="xs:string"> <xs:enumeration value=""/> <xs:enumeration value="RY"/> <xs:enumeration value="YR"/> </xs:restriction> </xs:simpleType> </xs:schema> It seems that both requests are validated by parsers (xercex1.4.4 and xerces2.x.x). When parsing with xerces1.4.4, all is OK whatever the request. But when parsing the second request with xerces2.x.x, an error occurs on sSearchWithinFiveDays. Error: org.xml.sax.SAXParseException: cvc-elt.4.3: Type 'xsd:string' is not validly derived from the type definition of element 'sSearchWithinFiveDays'. And it is true when looking at the schema, it should be 'ns0:sSearchWithinFiveDaysType' type (as well as the sRoute element). When switching to this type all is correct. Is it possible to raise the exception when validating the "wrong" request with special features or properties or is it a normal behaviour? Should the parser be "ready" for that kind of attribute? Thanx for your answers. Mederick --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
