We are implementing some of our newer services using AXIS 1.0 but are trying to keep some similarity to existing services we have.  One area I have run into is array serialization.  The object that is being serialized in the array is declared as <item> In our older calls the array element matches it's type or name.  Below is the AXIS generated result:
 
 <ns1:GetPkgFilesResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:schemas-wamnet-com:InfoCenter">
   <FileList xsi:type="soapenc:Array" soapenc:arrayType="ns1:FileInfo[2]" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <item>
     <UserFileName xsi:type="xsd:string">170101-174.jtk</UserFileName>
     <Size xsi:type="xsd:long">5692</Size>
    </item>
    <item>
     <UserFileName xsi:type="xsd:string">xml10.pdf</UserFileName>
     <Size xsi:type="xsd:long">176689</Size>
    </item>
   </FileList>
  </ns1:GetPkgFilesResponse>
 
For example <item> would be replaced with <FileInfo>.  I know that with the soapenc tells the type of the item in the array, but we want consistency with he older APIs we have.  I have been able to change the ArraySerializer to make it work the way I want with a simple 1 line change.  Below is the result after I changed the Serialize:
 
 <ns1:GetPkgFilesResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:schemas-wamnet-com:InfoCenter">
   <FileList xsi:type="soapenc:Array" soapenc:arrayType="ns1:FileInfo[2]" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <FileInfo>
     <UserFileName xsi:type="xsd:string">170101-174.jtk</UserFileName>
     <Size xsi:type="xsd:long">5692</Size>
    </FileInfo>
    <FileInfo>
     <UserFileName xsi:type="xsd:string">xml10.pdf</UserFileName>
     <Size xsi:type="xsd:long">176689</Size>
    </FileInfo>
   </FileList>
  </ns1:GetPkgFilesResponse>
 
Is there another way to do this or is this something that should be included as an option in axis?
 

----------------------------
Bill Grubbs
Consulting Software Engineer
Wam!Net
[EMAIL PROTECTED]
(248) 375-5896

 

Reply via email to