The most examples for Business Data Catalog(BDC) used a database connection, this is an easy way to connect to a foreign system. In some cases a own Web Service has advantages, because the Web Service can prepare the data for the moss search, for example child entity data can be included in the main entity.
The crawler of MOSS needs two operations for the indexing.
The first method (called “Id Enumerator”) must return all IDs for the entities, which must be indexed. If the indexer should crawl incremental, it must also return the last modified date of each ID.
The second method (called “Specific Finder”) becomes the ID and returns the data of the entity. The Entity may only contains simple type properties, and entities with complex type are not indexed.
I create an example Customer Web Service and the service contains for the search the two methods (Example). The Web Service must use a BasicHttpBinding, because the BDC in MOSS does not use WCF to connect to the Web Service.
To create a Business Data Catalog Definitions Microsoft publishes in the MOSS SDK the “Business Data Catalog Definition Editor”, which I use to create the definition file.
The First Step is to create a new LOB (line-of-business) System in the Business Data Catalog Definition Editor, connect it to the Web Service and define the entity and all its methods.
1. Add LOB System and connect to Web Service with the Web Service URL.
2. Drag and Drop all Methods for an Entity to the “Design Surface”
3. Press “OK” and define a name for the LOB System. The Editor creates an BDC Entity and in it the methods with all the Web Service Parameters (Arguments /Return Value)
4. Rename the Entity (“Customer”) and create the Identifier (“Id”)
The next step is to create the “Id Enumerator”, which returns all Ids for the customer entities
1. Define the Identifier Property with “Id(Customer)” in the Return parameter, to show the crawler which is the Id in the result entity.
2. Create the Instance with the name “GetCustomerIds” as an “Id Enumerator” and the Return type must be the “Ids” because the “Id Enumerator” must return a collection.
3. Execute the Method Instance “GetCustomerIds” to test the configuration. The result must be a list of Ids.
The next step is to create the “Specific Finder”, which returns one customer entity.
1. Define the Identifier Properties with “Id(Customer)” in the operation argument Id and in the Return parameter.
2. Create the Instance for the “GetCustomerById” as a “Specific Finder” and the Return type must be “Return”, which contains one Customer with all the entity properties, which must be indexed.
3. Execute the Method Instance “GetCustomerById” to test the configuration. The argument should be an existing id and then the result must the data of the entity.
Every BDC Entity should contain the “Title” property, which is used to define which Entity property is used as Title in the search result. If no title is defined, the title is the URL of the default action.
Open the Properties for the Entity (“Customer”) and add a property. The Property name must be “Title” and the property value must be the name of the TypeDescriptor in the Return Parameter of the “Specific Finder” method, which contains the title value.
If the crawler should support incremental crawling, and the Web Service returns a last modified date, the BDC Entity must contain the “__BdcLastModifiedTimestamp” property, which defines the name of his last modified property.
Open the Properties for the Entity (“Customer”) and add a property. The Property name must be “__BdcLastModifiedTimestamp” and the property value must be the name of the TypeDescriptor in the Return Parameter of the “Specific Finder” and “Id Enumerator” method, which contains the last modified date.
Posted
Jan 16 2008, 09:25 AM
by
Rolf Nebhuth