anthonyMission
Programmer
I am using the XMLSPY tool and JAXB.
Here is my schema snippet:
<xsd:complexType name="CustSearchResponseType">
<xsd:sequence>
<xsd:element name="header" type="HeaderType"/>
<xsd:element name="detailAvailable" type="xsd:boolean"/>
<xsd:choice>
<xsd:element name="custList" type="CustListType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="custNameRecord" type="CustNameRecordType"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CustListType">
<xsd:sequence>
<xsd:element name="location" type="xsd:string"/>
<xsd:element name="firstName" type="xsd:string"/>
<xsd:element name="lastName" type="xsd:string"/>
<xsd:element name="custExt" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CustNameRecordType">
<xsd:sequence>
<xsd:element name="locator" type="xsd:string"/>
<xsd:element name="recordType" type="xsd:string"/>
<xsd:element name="customer" type="CustomerType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CustomerType">
<xsd:sequence>
<xsd:element name="customerNumber" type="xsd:string"/>
<xsd:element name="firstName" type="xsd:string"/>
<xsd:element name="lastName" type="xsd:string"/>
<xsd:element name="address" type="xsd:string"/>
<xsd:element name="custPreference" type="CustPreferenceType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
I am populating data into the header infromation, detailAvailable but nothing else as I am trying to hit the custList = 0 condition.
But I am getting this error during the unmarshaling process:
Error
DefaultValidationEventHandler: [FATAL_ERROR]: Unexpected end of element {}:CustSearchResponse
Location:
javax.xml.bind.UnmarshalException: Unexpected end of element {}:CustSearchResponse
DefaultValidationEventHandler: [FATAL_ERROR]: Unexpected end of element {}:custNameRecordl
Location:
javax.xml.bind.UnmarshalException: Unexpected end of element {}:custNameRecord
java.lang.IllegalArgumentException: obj parameter must not be null
Any advice?
Here is my schema snippet:
<xsd:complexType name="CustSearchResponseType">
<xsd:sequence>
<xsd:element name="header" type="HeaderType"/>
<xsd:element name="detailAvailable" type="xsd:boolean"/>
<xsd:choice>
<xsd:element name="custList" type="CustListType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="custNameRecord" type="CustNameRecordType"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CustListType">
<xsd:sequence>
<xsd:element name="location" type="xsd:string"/>
<xsd:element name="firstName" type="xsd:string"/>
<xsd:element name="lastName" type="xsd:string"/>
<xsd:element name="custExt" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CustNameRecordType">
<xsd:sequence>
<xsd:element name="locator" type="xsd:string"/>
<xsd:element name="recordType" type="xsd:string"/>
<xsd:element name="customer" type="CustomerType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CustomerType">
<xsd:sequence>
<xsd:element name="customerNumber" type="xsd:string"/>
<xsd:element name="firstName" type="xsd:string"/>
<xsd:element name="lastName" type="xsd:string"/>
<xsd:element name="address" type="xsd:string"/>
<xsd:element name="custPreference" type="CustPreferenceType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
I am populating data into the header infromation, detailAvailable but nothing else as I am trying to hit the custList = 0 condition.
But I am getting this error during the unmarshaling process:
Error
DefaultValidationEventHandler: [FATAL_ERROR]: Unexpected end of element {}:CustSearchResponse
Location:
javax.xml.bind.UnmarshalException: Unexpected end of element {}:CustSearchResponse
DefaultValidationEventHandler: [FATAL_ERROR]: Unexpected end of element {}:custNameRecordl
Location:
javax.xml.bind.UnmarshalException: Unexpected end of element {}:custNameRecord
java.lang.IllegalArgumentException: obj parameter must not be null
Any advice?