Share via


How to: Model a Web Service That Returns an ArrayList

This sample shows how you can model a Web method that returns an ArrayList.

Example

<Entities>
 <Entity EstimatedInstanceCount="10000" Name="MyCustomers">
   <Properties>
    <Property Name="Key" Type="System.String">Key</Property>
   </Properties>
   <Identifiers>
    <Identifier TypeName="System.String" Name="Key" />
   </Identifiers>
   <Methods>
    <Method Name="GetMyCustomers">
     <Parameters>
      <Parameter Direction="Return" Name="Customers">
       <TypeDescriptor TypeName="MyWebServiceProxy.Customers[], 
MyWebService" IsCollection="true" Name="ArrayOfCustomers">
        <TypeDescriptors>
         <TypeDescriptor TypeName="MyWebServiceProxy.Customers, MyWebService" Name="Customers">
          <TypeDescriptors>
           <TypeDescriptor TypeName="System.String" IdentifierName="Key" Name="Key" />
           <TypeDescriptor TypeName="System.String" Name="Value" />
          </TypeDescriptors>
         </TypeDescriptor>
        </TypeDescriptors>
       </TypeDescriptor>
      </Parameter>
     </Parameters>
     <MethodInstances>
      <MethodInstance Type="Finder" ReturnParameterName="Customers" ReturnTypeDescriptorName="ArrayOfCustomers" 
ReturnTypeDescriptorLevel="0" Name="GetMyCustomersInstance" />
     </MethodInstances>
    </Method>
   </Methods>
  </Entity>
 </Entities>
</LobSystem>