You connect database applications through ADO.NET. All other applications, such as SAP R/3, or Microsoft Dynamics, use web services to connect to the Business Data Catalog. A great place to start is to examine the SampleWebService sample Application Definition file. First, this section explores the web service application definition–specific settings, and then later you modify the file to add a custom action.
Following is a high-level overview of web-service-specific settings for each of the Business Data Catalog elements.
Web Service Specific Properties of the LobSystem Object
For web-service-specific systems, these additional LobSystem object properties may be used. As might be expected, these properties deal with the security and communication aspects of a web service Business Data Catalog application, as illustrated in the following table.
Property | Description |
---|---|
WebProxyServerConfiguration | Configuration file location path. |
WebServiceProxyNamespace | Designated namespace used for web service proxy class generation. |
WebServiceProxyProtocol | Web service protocol. |
WebServiceProxyType | Fully qualified type name of a type in place of the autogenerated web service proxy. |
WsdlFetchAuthenticationMode | Authentication mode used while fetching the Web Service Discovery Language (WSDL) file. |
WsdlFetchSsoApplicationId | Fully qualified type name of the Single Service Offering Provider Interface (ISsoProvider) credential store implementation used while fetching the web services discovery document or WSDL file. |
WsdlFetchSsoProviderImplementation | Fully qualified type name of the Single Service Offering Provider Interface (ISsoProvider) implementation used while fetching the web services discovery document or WSDL file. |
WsdlFetchUrl | URL used for web service discovery. |
Web Service Specific Properties of the LobSystemInstance Object
For web-service-specific systems, these additional LobSystemInstance object properties can be used. As might be expected, these properties deal with the security and communication aspects of a web service Business Data Catalog application instance.
The power that the Business Data Catalog provides is impressive. In the following web service application definition file, Listing 10-3, all related functionality is exposed. You can expose all of your underlying application data through the set of corresponding Web Methods.
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <LobSystem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" Type="WebService" Version="1.0.0.0" Name="SampleWebService" xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog"> <Properties> <Property Name="WebServiceProxyNamespace" Type="System.String">SampleWebServiceProxy</Property> <Property Name="WildcardCharacter" Type="System.String">$</Property> <Property Name="WsdlFetchUrl" Type="System.String">http://localhost:8081/SampleWebServices/Service.asmx</Property> <Properties> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <LobSystemInstances> <LobSystemInstance Name="SampleWebServiceInstance"> <Properties> <Property Name="LobSystemName" Type="System.String">SampleWebService</Property> </Properties> </LobSystemInstance> </LobSystemInstances> <Entities> <Entity EstimatedInstanceCount="10000" Name="Customer"> <Properties> <Property Name="Title" Type="System.String">Name</Property> <Property Name="DefaultAction" Type="System.String">View Profile</Property> </Properties> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Identifiers> <Identifier TypeName="System.String" Name="CustomerID" /> </Identifiers> <Methods> <Method Name="GetChildCustomersForCustomer"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Parameters> <Parameter Direction="In" Name="custid"> <TypeDescriptor TypeName="System.String" IdentifierName="CustomerID" Name="custid" /> </Parameter> <Parameter Direction="Return" Name="Customers"> <TypeDescriptor TypeName="SampleWebServiceProxy.Customer[], SampleWebService" IsCollection="true" Name="ArrayOfCustomer"> <TypeDescriptors> <TypeDescriptor TypeName="SampleWebServiceProxy.Customer, SampleWebService" Name="Customer"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" IdentifierName="CustomerID" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" Name="Name" /> <TypeDescriptor TypeName="System.Int64" Name="WorkPhoneNumber" /> <TypeDescriptor TypeName="System.Int64" Name="MobilePhoneNumber" /> <TypeDescriptor TypeName="System.String" Name="Industry" /> <TypeDescriptor TypeName="System.String" Name="WebSite" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> </Method> <Method Name="GetCustomerIDs"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Parameters> <Parameter Direction="Return" Name="CustomerIDs"> <TypeDescriptor TypeName="System.String[]" IsCollection="true" Name="ArrayOfString"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" IdentifierName="CustomerID" Name="CustomerID" /> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="IdEnumerator" ReturnParameterName="CustomerIDs" ReturnTypeDescriptorName="ArrayOfString" ReturnTypeDescriptorLevel="0" Name="GetCustomerIDsInstance"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> </MethodInstance> </MethodInstances> </Method> <Method Name="GetCustomers"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <FilterDescriptors> <FilterDescriptor Type="Wildcard" Name="Name" /> <FilterDescriptor Type="Limit" Name="Limit" /> </FilterDescriptors> <Parameters> <Parameter Direction="In" Name="name"> <TypeDescriptor TypeName="System.String" AssociatedFilter="Name" Name="name" /> </Parameter> <Parameter Direction="In" Name="limit"> <TypeDescriptor TypeName="System.Int32" AssociatedFilter="Limit" Name="limit" /> </Parameter> <Parameter Direction="Return" Name="Customers"> <TypeDescriptor TypeName="SampleWebServiceProxy.Customer[], SampleWebService" IsCollection="true" Name="ArrayOfCustomer"> <TypeDescriptors> <TypeDescriptor TypeName="SampleWebServiceProxy.Customer, SampleWebService" Name="Customer"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" IdentifierName="CustomerID" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" Name="Name" /> <TypeDescriptor TypeName="System.Int64" Name= "WorkPhoneNumber" /> <TypeDescriptor TypeName="System.Int64" Name="MobilePhoneNumber" /> <TypeDescriptor TypeName="System.String" Name="Industry" /> <TypeDescriptor TypeName="System.String" Name="WebSite" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="Finder" ReturnParameterName="Customers" ReturnTypeDescriptorName="ArrayOfCustomer" ReturnTypeDescriptorLevel="0" Name="FindCustomerInstances"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> </MethodInstance> </MethodInstances> </Method> <Method Name="GetCustomerByID"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Parameters> <Parameter Direction="In" Name="id"> <TypeDescriptor TypeName="System.String" IdentifierName="CustomerID" Name="id" /> </Parameter> <Parameter Direction="Return" Name="Customer"> <TypeDescriptor TypeName="SampleWebServiceProxy.Customer, SampleWebService" Name="Customer"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" IdentifierName="CustomerID" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" Name="Name" /> <TypeDescriptor TypeName="System.Int64" Name="WorkPhoneNumber" /> <TypeDescriptor TypeName="System.Int64" Name="MobilePhoneNumber" /> <TypeDescriptor TypeName="System.String" Name="Industry" /> <TypeDescriptor TypeName="System.String" Name="WebSite" /> <TypeDescriptor TypeName="SampleWebServiceProxy.CustomerAddress[], SampleWebService" IsCollection="true" Name="CustomerAddresses"> <TypeDescriptors> <TypeDescriptor TypeName= "SampleWebServiceProxy.CustomerAddress, SampleWebService" Name="CustomerAddress"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" Name="BlockNumber" /> <TypeDescriptor TypeName="System.String" Name="Street" /> <TypeDescriptor TypeName="System.String" Name="City" /> <TypeDescriptor TypeName="System.String" Name="StateProvince" /> <TypeDescriptor TypeName="System.String" Name="CountryRegion" /> <TypeDescriptor TypeName="System.String" Name="PostalCode" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="SpecificFinder" ReturnParameterName="Customer" ReturnTypeDescriptorName="Customer" ReturnTypeDescriptorLevel="0" Name="FindCustomerInstance"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> </MethodInstance> </MethodInstances> </Method> </Methods> <Actions> <Action Position="1" IsOpenedInNewWindow="false" Url="http://windows2003base:11539/ssp/admin/Content/Customer.aspx?CustomerID={0}" ImageUrl="/_layouts/1033/images/viewprof.gif" Name="View Profile"> <ActionParameters> <ActionParameter Index="0" Name="CustomerID" /> </ActionParameters> </Action> </Actions> </Entity> <Entity EstimatedInstanceCount="10000" Name="Region"> <Properties> <Property Name="Title" Type="System.String">Name</Property> <Property Name="DefaultAction" Type="System.String">View Profile</Property> </Properties> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Identifiers> <Identifier TypeName="System.String" Name="RegionID" /> </Identifiers> <Methods> <Method Name="GetRegions"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <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"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> </MethodInstance> </MethodInstances> </Method> <Method Name="GetRegionByID"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <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"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> </MethodInstance> </MethodInstances> </Method> </Methods> <Actions> <Action Position="1" IsOpenedInNewWindow="false" Url="http://windows2003base:11539/ssp/admin/Content/Region.aspx?RegionID={0}" ImageUrl="/_layouts/1033/images/viewprof.gif" Name="View Profile"> <ActionParameters> <ActionParameter Index="0" Name="RegionID" /> </ActionParameters> </Action> </Actions> </Entity> <Entity EstimatedInstanceCount="10000" Name="Address"> <Properties> <Property Name="Title" Type="System.String">AddressID</Property> <Property Name="DefaultAction" Type="System.String">View Profile</Property> </Properties> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Identifiers> <Identifier TypeName="System.String" Name="AddressID" /> </Identifiers> <Methods> <Method Name="GetAddresses"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <FilterDescriptors> <FilterDescriptor Type="Wildcard" Name="CustomerID" /> </FilterDescriptors> <Parameters> <Parameter Direction="In" Name="name"> <TypeDescriptor TypeName="System.String" AssociatedFilter="CustomerID" Name="name" /> </Parameter> <Parameter Direction="Return" Name="Addresses"> <TypeDescriptor TypeName="SampleWebServiceProxy.CustomerAddress[], SampleWebService" IsCollection="true" Name="CustomerAddresses"> <TypeDescriptors> <TypeDescriptor TypeName="SampleWebServiceProxy.CustomerAddress, SampleWebService" Name="CustomerAddress"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" IdentifierName="AddressID" Name="AddressID" /> <TypeDescriptor TypeName="System.String" Name="BlockNumber" /> <TypeDescriptor TypeName="System.String" Name="Street" /> <TypeDescriptor TypeName="System.String" Name="City" /> <TypeDescriptor TypeName="System.String" Name="StateProvince" /> <TypeDescriptor TypeName="System.String" Name="CountryRegion" /> <TypeDescriptor TypeName="System.String" Name="PostalCode" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="Finder" ReturnParameterName="Addresses" ReturnTypeDescriptorName="CustomerAddresses" ReturnTypeDescriptorLevel="0" Name="GetAddressesInstance"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> </MethodInstance> </MethodInstances> </Method> <Method Name="GetAddressesForCustomer"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Parameters> <Parameter Direction="In" Name="custid"> <TypeDescriptor TypeName="System.String" IdentifierEntityName="Customer" IdentifierName="CustomerID" Name="custid" /> </Parameter> <Parameter Direction="Return" Name="Addresses"> <TypeDescriptor TypeName="SampleWebServiceProxy.CustomerAddress[], SampleWebService" IsCollection="true" Name="CustomerAddresses"> <TypeDescriptors> <TypeDescriptor TypeName="SampleWebServiceProxy.CustomerAddress, SampleWebService" Name="CustomerAddress"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" IdentifierName="AddressID" Name="AddressID" /> <TypeDescriptor TypeName="System.String" Name="BlockNumber" /> <TypeDescriptor TypeName="System.String" Name="Street" /> <TypeDescriptor TypeName="System.String" Name="City" /> <TypeDescriptor TypeName="System.String" Name="StateProvince" /> <TypeDescriptor TypeName="System.String" Name="CountryRegion" /> <TypeDescriptor TypeName="System.String" Name="PostalCode" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> </Method> <Method Name="GetAddressByID"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Parameters> <Parameter Direction="In" Name="id"> <TypeDescriptor TypeName="System.String" IdentifierName="AddressID" Name="id" /> </Parameter> <Parameter Direction="Return" Name="Address"> <TypeDescriptor TypeName="SampleWebServiceProxy.CustomerAddress, SampleWebService" Name="CustomerAddress"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" IdentifierName="AddressID" Name="AddressID" /> <TypeDescriptor TypeName="System.String" Name="BlockNumber" /> <TypeDescriptor TypeName="System.String" Name="Street" /> <TypeDescriptor TypeName="System.String" Name="City" /> <TypeDescriptor TypeName="System.String" Name="StateProvince" /> <TypeDescriptor TypeName="System.String" Name="CountryRegion" /> <TypeDescriptor TypeName="System.String" Name="PostalCode" /> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="SpecificFinder" ReturnParameterName="Address" ReturnTypeDescriptorName="CustomerAddress" ReturnTypeDescriptorLevel="0" Name="FindAddressInstance"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> </MethodInstance> </MethodInstances> </Method> </Methods> <Actions> <Action Position="1" IsOpenedInNewWindow="false" Url="http://windows2003base:11539/ssp/admin/Content/Address.aspx?AddressID={0}" ImageUrl="/_layouts/1033/images/viewprof.gif" Name="View Profile"> <ActionParameters> <ActionParameter Index="0" Name="AddressID" /> </ActionParameters> </Action> <Action Position="1" IsOpenedInNewWindow="true" Url="http://maps.google.com/maps?f=l&hl=en&q=%20{0}%20{1}%20{2}%20{3}%20{4}%20&ie=UTF-8&om=1&z=15&iwloc=addr&oe=UTF-8&sa=N&tab=wl"ImageUrl="" Name="View Location on Map"> <ActionParameters> <ActionParameter Index="0" Name="BlockNumber" /> <ActionParameter Index="1" Name="Street" /> <ActionParameter Index="2" Name="City" /> <ActionParameter Index="3" Name="StateProvince" /> <ActionParameter Index="4" Name="PostalCode" /> <ActionParameter Index="5" Name="CountryRegion" /> </ActionParameters> </Action> </Actions> </Entity> <Entity EstimatedInstanceCount="10000" Name="Order"> <Properties> <Property Name="Title" Type="System.String">OrderID</Property> <Property Name="DefaultAction" Type="System.String">View Profile</Property> </Properties> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Identifiers> <Identifier TypeName="System.String" Name="OrderID" /> </Identifiers> <Methods> <Method Name="GetOrdersForCustomerAndRegion"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <FilterDescriptors> <FilterDescriptor Type="Comparison" Name="CurrencyCode"> <Properties> <Property Name="Comparator" Type="System.String">Equals</Property> </Properties> </FilterDescriptor> </FilterDescriptors> <Parameters> <Parameter Direction="In" Name="custid"> <TypeDescriptor TypeName="System.String" IdentifierEntityName="Customer" IdentifierName="CustomerID" Name="custid" /> </Parameter> <Parameter Direction="In" Name="regid"> <TypeDescriptor TypeName="System.String" IdentifierEntityName="Region" IdentifierName="RegionID" Name="regid" /> </Parameter> <Parameter Direction="In" Name="curcode"> <TypeDescriptor TypeName="System.String" AssociatedFilter="CurrencyCode" Name="curcode" /> </Parameter> <Parameter Direction="Return" Name="Orders"> <TypeDescriptor TypeName="SampleWebServiceProxy.Order[], SampleWebService" IsCollection="true" Name="ArrayOfOrder"> <TypeDescriptors> <TypeDescriptor TypeName="SampleWebServiceProxy.Order,SampleWebService" Name="Order"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" IdentifierName="OrderID" Name="OrderID" /> <TypeDescriptor TypeName="System.String" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" Name="RegionID" /> <TypeDescriptor TypeName="System.String" Name="CurrencyCode" /> <TypeDescriptor TypeName="System.Decimal" Name="SubTotal" /> <TypeDescriptor TypeName="System.String" Name="OrderDate" /> <TypeDescriptor TypeName="System.String" Name="ShipDate" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> </Method> <Method Name="GetOrderByID"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Parameters> <Parameter Direction="In" Name="id"> <TypeDescriptor TypeName="System.String" IdentifierName="OrderID" Name="id" /> </Parameter> <Parameter Direction="Return" Name="Order"> <TypeDescriptor TypeName="SampleWebServiceProxy.Order, SampleWebService" Name="Order"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" IdentifierName="OrderID" Name="OrderID" /> <TypeDescriptor TypeName="System.String" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" Name="RegionID" /> <TypeDescriptor TypeName="System.String" Name="CurrencyCode" /> <TypeDescriptor TypeName="System.Decimal" Name="SubTotal" /> <TypeDescriptor TypeName="System.String" Name="OrderDate" /> <TypeDescriptor TypeName="System.String" Name="ShipDate" /> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="SpecificFinder" ReturnParameterName="Order"ReturnTypeDescriptorName="Order" ReturnTypeDescriptorLevel="0" Name="FindOrderInstance"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> </MethodInstance> </MethodInstances> </Method> <Method Name="GetOrders"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Parameters> <Parameter Direction="Return" Name="Orders"> <TypeDescriptor TypeName="SampleWebServiceProxy.Order[], SampleWebService" IsCollection="true" Name="ArrayOfOrder"> <TypeDescriptors> <TypeDescriptor TypeName="SampleWebServiceProxy.Order,SampleWebService" Name="Order"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" IdentifierName="OrderID" Name="OrderID" /> <TypeDescriptor TypeName="System.String" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" Name="RegionID" /> <TypeDescriptor TypeName="System.String" Name="CurrencyCode" /> <TypeDescriptor TypeName="System.Decimal" Name="SubTotal" /> <TypeDescriptor TypeName="System.String" Name="OrderDate" /> <TypeDescriptor TypeName="System.String" Name="ShipDate" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="Finder" ReturnParameterName="Orders" ReturnTypeDescriptorName="ArrayOfOrder" ReturnTypeDescriptorLevel="0" Name="FindOrderInstances"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> </MethodInstance> </MethodInstances> </Method> </Methods> <Actions> <Action Position="1" IsOpenedInNewWindow="false" Url="http://windows2003base:11539/ssp/admin/Content/Order.aspx?OrderID={0}" ImageUrl="/_layouts/1033/images/viewprof.gif" Name="View Profile"> <ActionParameters> <ActionParameter Index="0" Name="OrderID" /> </ActionParameters> </Action> </Actions> </Entity> <Entity EstimatedInstanceCount="10000" Name="LineItem"> <Properties> <Property Name="Title" Type="System.String">ProductName</Property> <Property Name="DefaultAction" Type="System.String">View Profile</Property> </Properties> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Identifiers> <Identifier TypeName="System.String" Name="OrderID" /> <Identifier TypeName="System.String" Name="ProductID" /> </Identifiers> <Methods> <Method Name="GetLineItemsForOrder"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Parameters> <Parameter Direction="In" Name="ordid"> <TypeDescriptor TypeName="System.String" IdentifierEntityName="Order"IdentifierName="OrderID" Name="ordid" /> </Parameter> <Parameter Direction="Return" Name="LineItems"> <TypeDescriptor TypeName="SampleWebServiceProxy.LineItem[], SampleWebService" IsCollection="true" Name="ArrayOfLineItem"> <TypeDescriptors> <TypeDescriptor TypeName="SampleWebServiceProxy.LineItem, SampleWebService" Name="LineItem"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" IdentifierName="OrderID" Name="OrderID" /> <TypeDescriptor TypeName="System.String" IdentifierName="ProductID" Name="ProductID" /> <TypeDescriptor TypeName="System.String" Name="ProductName" /> <TypeDescriptor TypeName="System.Int32" Name="OrderQty" /> <TypeDescriptor TypeName="System.Decimal" Name="UnitPrice" /> <TypeDescriptor TypeName="System.Decimal" Name="LineTotal" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> </Method> <Method Name="GetLineItemByID"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Parameters> <Parameter Direction="In" Name="ordid"> <TypeDescriptor TypeName="System.String" IdentifierName="OrderID" Name="ordid" /> </Parameter> <Parameter Direction="In" Name="prodid"> <TypeDescriptor TypeName="System.String" IdentifierName="ProductID" Name="prodid" /> </Parameter> <Parameter Direction="Return" Name="LineItem"> <TypeDescriptor TypeName="SampleWebServiceProxy.LineItem,SampleWebService" Name="LineItem"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" IdentifierName="OrderID" Name="OrderID" /> <TypeDescriptor TypeName="System.String" IdentifierName="ProductID" Name="ProductID" /> <TypeDescriptor TypeName="System.String" Name="ProductName" /> <TypeDescriptor TypeName="System.Int32" Name="OrderQty" /> <TypeDescriptor TypeName="System.Decimal" Name="UnitPrice" /> <TypeDescriptor TypeName="System.Decimal" Name="LineTotal" /> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="SpecificFinder" ReturnParameterName="LineItem" ReturnTypeDescriptorName="LineItem" ReturnTypeDescriptorLevel="0" Name="FindLineItemInstance"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> </MethodInstance> </MethodInstances> </Method> <Method Name="GetLineItems"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <Parameters> <Parameter Direction="Return" Name="LineItems"> <TypeDescriptor TypeName="SampleWebServiceProxy.LineItem[], SampleWebService" IsCollection="true" Name="ArrayOfLineItem"> <TypeDescriptors> <TypeDescriptor TypeName="SampleWebServiceProxy.LineItem, SampleWebService" Name="LineItem"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" IdentifierName="OrderID" Name="OrderID" /> <TypeDescriptor TypeName="System.String" IdentifierName="ProductID" Name="ProductID" /> <TypeDescriptor TypeName="System.String" Name="ProductName" /> <TypeDescriptor TypeName="System.Int32" Name="OrderQty" /> <TypeDescriptor TypeName="System.Decimal" Name="UnitPrice" /> <TypeDescriptor TypeName="System.Decimal" Name="LineTotal" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="Finder" ReturnParameterName="LineItems"ReturnTypeDescriptorName="ArrayOfLineItem" ReturnTypeDescriptorLevel="0" Name="FindLineItemInstances"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> </MethodInstance> </MethodInstances> </Method> </Methods> <Actions> <Action Position="1" IsOpenedInNewWindow="false" Url="http://windows2003base:11539/ssp/admin/Content/LineItem.aspx?OrderID={0}&ProductID={1}" ImageUrl="/_layouts/1033/images/viewprof.gif" Name="View Profile"> <ActionParameters> <ActionParameter Index="0" Name="OrderID" /> <ActionParameter Index="1" Name="ProductID" /> </ActionParameters> </Action> </Actions> </Entity> </Entities> <Associations> <Association Name="CustomerToChildCustomers" AssociationMethodEntityName="Customer" AssociationMethodName="GetChildCustomersForCustomer" AssociationMethodReturnParameterName="Customers" AssociationMethodReturnTypeDescriptorName="ArrayOfCustomer" AssociationMethodReturnTypeDescriptorLevel="0" IsCached="true"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <SourceEntity Name="Customer" /> <DestinationEntity Name="Customer" /> </Association> <Association Name="CustomerAndRegionToOrders" AssociationMethodEntityName="Order" AssociationMethodName="GetOrdersForCustomerAndRegion" AssociationMethodReturnParameterName="Orders" AssociationMethodReturnTypeDescriptorName="ArrayOfOrder" AssociationMethodReturnTypeDescriptorLevel="0" IsCached="true"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <SourceEntity Name="Customer" /> <SourceEntity Name="Region" /> <DestinationEntity Name="Order" /> </Association> <Association Name="CustomerToAddresses" AssociationMethodEntityName="Address" AssociationMethodName="GetAddressesForCustomer" AssociationMethodReturnParameterName="Addresses" AssociationMethodReturnTypeDescriptorName="CustomerAddresses" AssociationMethodReturnTypeDescriptorLevel="0" IsCached="true"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <SourceEntity Name="Customer" /> <DestinationEntity Name="Address" /> </Association> <Association Name="OrderToLineItems" AssociationMethodEntityName="LineItem" AssociationMethodName="GetLineItemsForOrder" AssociationMethodReturnParameterName="LineItems" AssociationMethodReturnTypeDescriptorName="ArrayOfLineItem" AssociationMethodReturnTypeDescriptorLevel="0" IsCached="true"> <AccessControlList> <AccessControlEntry Principal="MOSSadministrator"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> <AccessControlEntry Principal="MOSSjohn"> <Right BdcRight="Edit" /> <Right BdcRight="Execute" /> <Right BdcRight="SetPermissions" /> <Right BdcRight="SelectableInClients" /> </AccessControlEntry> </AccessControlList> <SourceEntity Name="Order" /> <DestinationEntity Name="LineItem" /> </Association> </Associations> </LobSystem> |
Now that you have seen the different elements that compose an Application Definition file, this section will walk you through modifying the SampleWebService sample from MSDN to add a full Address Entity instead of an Address child within the Customer Entity.
The setup instructions for the SampleWebService can be found on this book's companion web site. You'll need to install the SampleWebService before attempting to test the changes to the application definition.
You start by examining the Address entity in the original file. Note that Address is really nothing more than a blob of data. It has no way to identify specific instances of the Address entity and no facility. In order to make this a first class entity, you'll make these changes and more.
<Entity EstimatedInstanceCount="10000" Name="Address"> <Properties> <Property Name="Title" Type="System.String">StateProvince</Property> </Properties> <Methods> <Method Name="GetAddresses"> <Parameters> <Parameter Direction="Return" Name="Addresses"> <TypeDescriptor TypeName="SampleWebServiceProxy.CustomerAddress[], SampleWebService" IsCollection="true" Name="CustomerAddresses" > <TypeDescriptors> <TypeDescriptor TypeName="SampleWebServiceProxy.CustomerAddress, SampleWebService" Name="CustomerAddress" > <Properties> <Property Name="FormatString" Type="System.String">{0}, {1}, {2}, {3} - PostalCode, {4}</Property> </Properties> <TypeDescriptors> <TypeDescriptor TypeName="SampleWebServiceProxy.CustomerStreet, SampleWebService" Name="Street"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" Name="BlockNumber" /> <TypeDescriptor TypeName="System.String" Name="Street" /> </TypeDescriptors> </TypeDescriptor> <TypeDescriptor TypeName="System.String" Name="City" /> <TypeDescriptor TypeName="System.String" Name="StateProvince" />
<TypeDescriptor TypeName="System.String" Name="CountryRegion" /> <TypeDescriptor TypeName="System.String" Name="PostalCode" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="Finder" ReturnParameterName="Addresses" ReturnTypeDescriptorName="CustomerAddresses" ReturnTypeDescriptorLevel="0"Name="GetAddressesInstance" /> </MethodInstances> </Method> </Methods> </Entity>
After examining the web service Application Definition file, you can now modify it to make the Customer Address Entity into a first class member.
Before undertaking the modification, you need to replace the information in the WsdlFetchUrl property with your server information.
<Property Name="WsdlFetchUrl" Type="System.String">http://localhost:8081/SampleWebServices/Service.asmx</Property> </Properties>
The first item you need to add to the Address Entity is an Identifier. Without the Identifier in place, the Entity is nothing more than a data instance. If you want to use it in a meaningful way within the portal site, then this is a crucial first step. So to do this, inside the Address Entity, immediately following the Properties element, add the Identifier:
</Properties> <Identifiers> <Identifier TypeName="System.String" Name="AddressID" /> </Identifiers>
This enables the Entity to expose individual instances based on the identifier.
Now that an Identifier has been added to the Address Entity, the next step is to expand the data choices provided by the Entity. This is accomplished by expanding the Methods, as illustrated in the following code sample. The first method is used as the destination.
<Method Name="GetAddressesForCustomer"> <Parameters> <Parameter Direction="In" Name="custid"> <TypeDescriptor TypeName="System.String" IdentifierEntityName="Customer" IdentifierName="CustomerID" Name="custid" /> </Parameter> <Parameter Direction="Return" Name="Addresses"> <TypeDescriptor TypeName="SampleWebServiceProxy.CustomerAddress[], SampleWebService" IsCollection="true" Name="CustomerAddresses">
<TypeDescriptors> <TypeDescriptor TypeName="SampleWebServiceProxy.CustomerAddress, SampleWebService" Name="CustomerAddress"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" IdentifierName="AddressID" Name="AddressID" /> <TypeDescriptor TypeName="System.String" Name="BlockNumber" /> <TypeDescriptor TypeName="System.String" Name="Street" /> <TypeDescriptor TypeName="System.String" Name="City" /> <TypeDescriptor TypeName="System.String" Name="StateProvince" /> <TypeDescriptor TypeName="System.String" Name="CountryRegion" /> <TypeDescriptor TypeName="System.String" Name="PostalCode" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> </Method> <Method Name="GetAddressByID"> <Parameters> <Parameter Direction="In" Name="id"> <TypeDescriptor TypeName="System.String" IdentifierName="AddressID" Name="id" /> </Parameter> <Parameter Direction="Return" Name="Address"> <TypeDescriptor TypeName="SampleWebServiceProxy.CustomerAddress, SampleWebService" Name="CustomerAddress"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" IdentifierName="AddressID" Name="AddressID" /> <TypeDescriptor TypeName="System.String" Name="BlockNumber" /> <TypeDescriptor TypeName="System.String" Name="Street" /> <TypeDescriptor TypeName="System.String" Name="City" /> <TypeDescriptor TypeName="System.String" Name="StateProvince" /> <TypeDescriptor TypeName="System.String" Name="CountryRegion" /> <TypeDescriptor TypeName="System.String" Name="PostalCode" /> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="SpecificFinder" ReturnParameterName="Address" ReturnTypeDescriptorName="CustomerAddress" ReturnTypeDescriptorLevel="0" Name="FindAddressInstance" /> </MethodInstances> </Method>
Notice that by adding these methods to the Address Entity, a specific instance can be retrieved and an association can be supported. This is important because it enables items to be surfaced through Web Parts and actions to be added for those instances.
Even though the Entity's method capabilities have been substanstially enhanced, in order to utlize this, the Address Entity needs to be associated with the Customer Entity. Once this is done, when a Customer is chosen, the corresponding Addresses can be displayed. To add an Association, add the following shaded code immediately before the Associations ending tag.
<Association Name="CustomerToAddresses" AssociationMethodEntityName="Address" AssociationMethodName="GetAddressesForCustomer" AssociationMethodReturnParameterName="Addresses" AssociationMethodReturnTypeDescriptorName="CustomerAddresses" AssociationMethodReturnTypeDescriptorLevel="0" IsCached="true"> <SourceEntity Name="Customer" /> <DestinationEntity Name="Address" /> </Association> </Associations> </LobSystem>
As discussed earlier, actions can be added to an Entity to perform additional functions. In this case, CustomerAddresses can be mapped via URL to display location information for the given customer address. In order to add the action, you need to add the following code immediately following the Methods closing tag. Note that you are adding actions to display the location in both Microsoft Live Maps and Google Maps to illustrate the flexibility of Actions.
</Methods> <Actions> <Action Position="1" IsOpenedInNewWindow="true" Url="http://maps.google.com/maps?f=l&hl=en&q=%20{0}%20{1}%20{2}%20{3}%20{4}%20&ie=UTF-8&om=1&z=15&iwloc=addr&oe=UTF-8&sa=N&tab=wl" ImageUrl="" Name="View in Google Maps"> <ActionParameters> <ActionParameter Index="0" Name="BlockNumber" /> <ActionParameter Index="1" Name="Street" /> <ActionParameter Index="2" Name="City" /> <ActionParameter Index="3" Name="StateProvince" /> <ActionParameter Index="4" Name="PostalCode" /> <ActionParameter Index="5" Name="CountryRegion" /> </ActionParameters> </Action> <Action Position="1" IsOpenedInNewWindow="true" Url="http://maps.live.com/?q={0}%20{1}%20{2}%20{3}%20{4}%20{5}&mkt=en-US&FORM=BDRE" ImageUrl=""Name="View In Live Map"> <ActionParameters> <ActionParameter Index="0" Name="BlockNumber" /> <ActionParameter Index="1" Name="Street" /> <ActionParameter Index="2" Name="City" /> <ActionParameter Index="3" Name="StateProvince" /> <ActionParameter Index="4" Name="PostalCode" /> <ActionParameter Index="5" Name="CountryRegion" /> </ActionParameters> </Action> </Actions>
Before testing the modifications, save the file. Next, return to the Application Definition Import page and import your file to register the application within the Business Data Catalog.
Now, test that application and view the address location.
There are several Web Parts specifically designed for surfacing Business Data Catalog application data. Currently, there are five Web Parts set apart for this use. The following table lists the five Web Parts and their usage:
Web Part | Description |
---|---|
Business Data Action | Enables the use of an action via a URL for a given Entity. |
Business Data Item | Used to display a specific single Entity instance. |
Business Data Item Builder | Enables the creation of dynamic Entity instances based on a querystring from a URL and surfaces it through a profile page. |
Business Data List | Used to display a list of Entity instances. |
Business Data Related List | Allows associated Entity instances to be displayed. |
The Microsoft Office SharePoint Server 2007 Runtime object model allows you to navigate through the hierarchical structure of the registered line-of-business application. This example helps pull together many of the concepts in this chapter. It's time to walk through creating a simple application to illustrate navigating the API structure programmatically.
Before you can work with the code, there is a bit of housekeeping to take care of. The following steps will assist in performing a preliminary setup:
After launching Microsoft Visual Studio 2005, create a Console Application Project.
Add these references by browsing to the following paths:
C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12ISAPIMicrosoft.SharePoint.dll
C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12ISAPImicrosoft.sharepoint.portal.dll
C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12ISAPIMicrosoft.Office.Server.dll
You should now have three references, as illustrated in the rectangle shown in Figure 10-5.
Add the following references at the top of Program.cs:
using Microsoft.Office.Server.ApplicationRegistry.MetadataModel; using Microsoft.Office.Server.ApplicationRegistry.Infrastructure;
After the class definition, add a constant for the shared service server name:
class MOSSInfo { const string _sSPName = "SharedServices1";
After the Main function, add the following function. This function is responsible for setting your SharedServices provider instance.
static void ConnectToSharedResourceProvider() { SqlSessionProvider.Instance().SetSharedResourceProviderToUse(_sSPName); }
After the ConnectToSharedResourceProvider that you just added, add the following function:
static void DisplayLOBSystemInformation() {
NamedLobSystemInstanceDictionary sysInstances = ApplicationRegistry.GetLobSystemInstances(); Console.WriteLine("Listing system instances..."); foreach (String name in sysInstances.Keys) { Console.WriteLine( "LOBSystemInstance: " + name); } }
When run, this will display the line-of-business application instances, as illustrated in Figure 10-6.
Within the DisplayLOBSystemInformation function, add the following shaded lines to display the Entities contained inside the line-of-business application (LOBSystemInstance):
static void DisplayLOBSystemInformation() { NamedLobSystemInstanceDictionary sysInstances = ApplicationRegistry.GetLobSystemInstances(); Console.WriteLine("Listing system instances..."); foreach (String name in sysInstances.Keys) { Console.WriteLine( "LOBSystemInstance: " + name); NamedEntityDictionary entities = ApplicationRegistry.GetLobSystemInstanceByName(name).GetEntities(); foreach (Entity entity in entities.Values) { Console.WriteLine(" "); Console.WriteLine(" Entity: " + entity.Name); } } }
When run, this will display the Entities within the line-of-business application instances as illustrated in Figure 10-7.
Within the DisplayLOBSystemInformation function, add the following shaded lines to display Associations for the Entities contained inside the line-of-business application (LOBSystemInstance):
static void DisplayLOBSystemInformation() { NamedLobSystemInstanceDictionary sysInstances = ApplicationRegistry.GetLobSystemInstances(); Console.WriteLine("Listing system instances..."); foreach (String name in sysInstances.Keys) { Console.WriteLine( "LOBSystemInstance: " + name); NamedEntityDictionary entities = ApplicationRegistry.GetLobSystemInstanceByName(name).GetEntities(); foreach ( Entity entity in entities.Values) { Console.WriteLine(" "); Console.WriteLine(" Entity: " + entity.Name); View view = entity.GetFinderView(); NamedAssociationDictionary sourceAssociations = entity.GetSourceAssociations(); NamedAssociationDictionary destinationAssociations = entity.GetDestinationAssociations(); foreach (Field field in view.Fields) { Console.WriteLine(" Field: " + field.DefaultDisplayName + ", " + field.TypeDescriptor.TypeName);
} Console.WriteLine(" "); foreach (Association association in sourceAssociations.Values) { Console.WriteLine(" Source Association: " + association.Name); } Console.WriteLine(" "); foreach (Association association in destinationAssociations.Values) { Console.WriteLine(" Destination Association: " + association.Name); } } } }
When run, this will display the Associations for the Entities within the line-of-business application instances, as illustrated in Figure 10-8.
3.139.104.214