Authoring Step 6: Define the Region entity

At its basic level, an entity consists of a title (defined in the Properties element), a unique identifier (which equates to a primary key), and methods that are used to both define the fields of an entity as well as tell the Business Data Catalog how to pull the entity data out of the LOB system.

In the case of databases, a Business Data Catalog method contains a Properties element that defines the database query, a Parameters element that defines the data returned from the query, and a MethodInstances element that defines the different ways the method can be called. However, in the case of Web services, a method describes the Web method to invoke to get the desired data. The method name should match the Web method name and the Parameters element defines the data returned from the Web method; a MethodInstances element defines the different ways the method can be called. All names and types should match the names and types in the Web services proxy.

In this step, you will define an entity named Region. The Region entity is very straightforward with just Finder and SpecificFinder methods.

Prerequisites

Authoring Step 5: Define the Customer entity

To define the Region entity

  • Add the XML for the Region entity after the Customer entity element. This XML defines the entity’s title, identifier, and a method to return regions.

        <Entity EstimatedInstanceCount="10000" Name="Region">
          <Properties>
            <Property Name="Title" Type="System.String">Name</Property>
          </Properties>
          <Identifiers>
            <Identifier TypeName="System.String" Name="RegionID" />
          </Identifiers>
          <Methods>
            <Method Name="GetRegions">
              <FilterDescriptors>
                <FilterDescriptor Type="Wildcard" Name="Name" />
              </FilterDescriptors>
              <Parameters>
                <Parameter Direction="In" Name="name">
                  <TypeDescriptor TypeName="System.String" AssociatedFilter="Name" Name="name" />
                </Parameter>
                <Parameter Direction="Return" Name="Regions">
                  <TypeDescriptor TypeName="SampleWebServiceProxy.Region[], SampleWebService" IsCollection="true" Name="ArrayOfRegion">
                    <TypeDescriptors>
                      <TypeDescriptor TypeName="SampleWebServiceProxy.Region, SampleWebService" Name="Region">
                        <TypeDescriptors>
                          <TypeDescriptor TypeName="System.String" IdentifierName="RegionID" Name="RegionID" />
                          <TypeDescriptor TypeName="System.String" Name="Name" />
                          <TypeDescriptor TypeName="System.String" Name="Group" />
                          <TypeDescriptor TypeName="System.Decimal" Name="SalesLastYear" />
                          <TypeDescriptor TypeName="System.Decimal" Name="SalesYTD" />
                        </TypeDescriptors>
                      </TypeDescriptor>
                    </TypeDescriptors>
                  </TypeDescriptor>
                </Parameter>
              </Parameters>
              <MethodInstances>
                <MethodInstance Type="Finder" ReturnParameterName="Regions" ReturnTypeDescriptorName="ArrayOfRegion" ReturnTypeDescriptorLevel="0" Name="FindRegionInstances" />
              </MethodInstances>
            </Method>
            <Method Name="GetRegionByID">
              <Parameters>
                <Parameter Direction="In" Name="id">
                  <TypeDescriptor TypeName="System.String" IdentifierName="RegionID" Name="id" />
                </Parameter>
                <Parameter Direction="Return" Name="Region">
                  <TypeDescriptor TypeName="SampleWebServiceProxy.Region, SampleWebService" Name="Region">
                    <TypeDescriptors>
                      <TypeDescriptor TypeName="System.String" IdentifierName="RegionID" Name="RegionID" />
                      <TypeDescriptor TypeName="System.String" Name="Name" />
                      <TypeDescriptor TypeName="System.String" Name="Group" />
                      <TypeDescriptor TypeName="System.Decimal" Name="SalesLastYear" />
                      <TypeDescriptor TypeName="System.Decimal" Name="SalesYTD" />
                    </TypeDescriptors>
                  </TypeDescriptor>
                </Parameter>
              </Parameters>
              <MethodInstances>
                <MethodInstance Type="SpecificFinder" ReturnParameterName="Region" ReturnTypeDescriptorName="Region" ReturnTypeDescriptorLevel="0" Name="FindRegionInstance" />
              </MethodInstances>
            </Method>
          </Methods>
        </Entity>
    

Next Steps

Authoring Step 7: Define the Order entity