You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by SupratikDebnath <su...@gmail.com> on 2009/04/11 05:01:28 UTC

Hierarchy not maintained for Array Type

Hi All,

I am facing a stange issue with ArrayType object.
To start with below is a section of the XSD I am using:

	<xs:element name="getPOIDocumentResponse"
type="tns:getPOIDocumentResponseType"/>
	<xs:complexType name="getPOIDocumentResponseType">
		<xs:sequence>
			<xs:element name="ReturnCode" type="xs:string"/>
			<xs:element name="JobId" type="xs:string"/>
			<xs:element name="POIDocuments" minOccurs="0">
				<xs:complexType>
					<xs:sequence>
						<xs:element ref="tns:POIDocument" maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="ErrorSet" minOccurs="0">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="ErrorCode" type="xs:string"/>
						<xs:element name="ErrorMessage" type="xs:string"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>

Now below is a sample Response XML generated out of it:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <getPOIDocumentResponse xmlns="http://abc.com/abcWS/">
         <ReturnCode>0</ReturnCode>
         <JobId>1239333346058</JobId>
         <POIDocuments xsi:type="ns1:POIDocumentType"
xmlns:ns1="http://abc.com/abcWS/">
            <Status/>
            <DocumentCategory/>
            <DocumentType/>
            <DocumentID>23222172</DocumentID>
            <IssuingCountry>MEX</IssuingCountry>
            <IssuingState/>
            <IssuingAuthority>MEXICO</IssuingAuthority>
            <IssueDate>1962-09-12</IssueDate>
            <ExpiryDate/>
            <FamilyName>NEWPOICLIENTA</FamilyName>
            <GivenNames>BARRY</GivenNames>
            <Sex>M</Sex>
            <BirthDate>1952/06/24</BirthDate>
            <BirthCountry/>
            <BirthPlace>MEXICO</BirthPlace>
            <RegistrationDate/>
            <MarriageDate/>
            <MarriagePlace/>
            <SpouseFamilyNames/>
            <SpouseGivenNames/>
            <SpouseBirthDate/>
            <SpouseBirthPlace/>
            <SpouseNationality/>
            <DivorceDate/>
            <DeathDate xsi:nil="true"/>
            <PreviousFamilyName/>
            <PreviousGivenNames/>
            <ReasonForNameChange/>
            <NationalityOfBearer>MEX</NationalityOfBearer>
            <Parent1FamilyName/>
            <Parent1GivenNames/>
            <Parent1BirthDate/>
            <Parent2FamilyName/>
            <Parent2GivenNames/>
            <Parent2BirthDate/>
            <ContainsPhotograph>true</ContainsPhotograph>
            <Notes/>
            <EndDate/>
            <EndReason/>
            <EndReasonNotes/>
            <OtherDocumentType/>
           
<NationalIdentityNumber>1111111111111111111111111</NationalIdentityNumber>
            <ScannedDocumentImages>
               <ScannedDocumentImage>
                  <AttachedScanImageObjectJPEG/>
               </ScannedDocumentImage>
            </ScannedDocumentImages>
            <Source/>
            <Translation/>
            <Translator/>
            <IncludesPhoto/>
            <ScanReference/>
            <OfficerDerivedEndDate/>
            <OfficerDerivedEndReason/>
         </POIDocuments>
         <POIDocuments xsi:type="ns2:POIDocumentType"
xmlns:ns2="http://abc.com/abcWS/">
            <Status/>
            <DocumentCategory/>
            <DocumentType>RANDOM DOCUMENT</DocumentType>
            <DocumentID>23222259</DocumentID>
            <IssuingCountry>MDV</IssuingCountry>
            <IssuingState/>
            <IssuingAuthority/>
            <IssueDate/>
            <ExpiryDate/>
            <FamilyName>NEWPOICLIENTA</FamilyName>
            <GivenNames>BARRY</GivenNames>
            <Sex/>
            <BirthDate/>
            <BirthCountry/>
            <BirthPlace/>
            <RegistrationDate/>
            <MarriageDate/>
            <MarriagePlace/>
            <SpouseFamilyNames/>
            <SpouseGivenNames/>
            <SpouseBirthDate/>
            <SpouseBirthPlace/>
            <SpouseNationality/>
            <DivorceDate/>
            <DeathDate xsi:nil="true"/>
            <PreviousFamilyName/>
            <PreviousGivenNames/>
            <ReasonForNameChange/>
            <NationalityOfBearer>MEX</NationalityOfBearer>
            <Parent1FamilyName/>
            <Parent1GivenNames/>
            <Parent1BirthDate/>
            <Parent2FamilyName/>
            <Parent2GivenNames/>
            <Parent2BirthDate/>
            <ContainsPhotograph>true</ContainsPhotograph>
            <Notes/>
            <EndDate/>
            <EndReason/>
            <EndReasonNotes/>
            <OtherDocumentType/>
            <NationalIdentityNumber/>
            <ScannedDocumentImages>
               <ScannedDocumentImage>
                  <AttachedScanImageObjectJPEG/>
               </ScannedDocumentImage>
            </ScannedDocumentImages>
            <Source/>
            <Translation/>
            <Translator/>
            <IncludesPhoto/>
            <ScanReference/>
            <OfficerDerivedEndDate/>
            <OfficerDerivedEndReason/>
         </POIDocuments>
         <ErrorSet xsi:type="ns3:ErrorSet"
xmlns:ns3="http://abc.com/abcWS/">
            <ErrorCode/>
            <ErrorMessage/>
         </ErrorSet>
      </getPOIDocumentResponse>
   </soapenv:Body>
</soapenv:Envelope>

As you can see the Response xml is not maintaining the hierarchy as
mentioned in the XSD.

POIDocuments should have an array of POIDocument, but POIDocuments itself is
repeating like an array.

Any help will be greatly appreciated.

Regards,
Supratik
-- 
View this message in context: http://www.nabble.com/Hierarchy-not-maintained-for-Array-Type-tp22997521p22997521.html
Sent from the Axis - User mailing list archive at Nabble.com.