Creating a Web Service Connection by using the Business Data Catalog Definition Editor
Summary: Learn how to create a Web service connection for the Business Data Catalog in Microsoft Office SharePoint Server 2007 by using the Microsoft Business Data Catalog Definition Editor tool for Microsoft Office SharePoint Server 2007. (32 printed pages)
Jo-Anne West, Microsoft Corporation
August 2007
Applies to: Microsoft Office SharePoint Server 2007
Contents:
Overview of Business Data Catalog Definition Editor
Adding an LOB System
Configuring the SampleWebService LOB System Settings
Configuring the Customer Entity Name and Identifier
Configuring the Customer Entity Methods
Creating Method Instances
Creating Associations
Testing the Method Instances
Exporting the LOB System Instance Metadata
Importing the Application Definition File into the Shared Services Provider
Modifying an Existing Application Definition by using the Business Data Catalog Definition Editor
Next Steps
Conclusion
Additional Resources
Overview of Business Data Catalog Definition Editor
The Business Data Catalog in Microsoft Office SharePoint Server 2007 exposes and incorporates line-of-business (LOB) data into other baseline portal functionality, such as lists and Enterprise Search. To incorporate this data into your portal site, you must build an application definition file, which is an XML file that identifies where the data is stored (either in a database, or as a Web service) and what format the data is stored in (for example, what the data types and primary keys are).
For more information about the Business Data Catalog, see Business Data Catalog. For more information about Enterprise Search and the Business Data Catalog, see Enabling Business Data Search, and Searching Business Data. For details about how you can use the Business Data Catalog Definition editor to create a connection to database, see Creating a Database Connection by using the Business Data Catalog Definition Editor.
The Microsoft Business Data Catalog Definition Editor helps you to create application definition files for the Business Data Catalog. This tool automatically generates the XML for the definition file, so you do not need to manually create the file in an XML editor.
This how-to topic shows you how to create an application definition file for the Business Data Catalog and how to create a connection to a Web service by using the new Business Data Catalog Definition Editor. This example uses the Walkthrough: Sample Web Service, included with the Microsoft Office SharePoint Server 2007 Software Development Kit (SDK).
System Requirements
Before you begin, you must install the following:
Microsoft Office SharePoint Server 2007, Enterprise Edition.
Microsoft Business Data Catalog Definition Editor. This tool is part of the Microsoft Office SharePoint Server 2007 SDK download (beginning with the 1.2 release, August 2007).
To build a Business Data Catalog application definition file, use the following procedures.
Adding an LOB System
Begin by adding a LOB system.
To add an LOB system
On the Start menu, click Microsoft Business Data Application Definition Editor.
In the tool, click Add LOB System.
Figure 1. Add LOB System
In the Add LOB System window, click Connect to Webservice.
Enter the Web service URL.
Figure 2. Entering the Web service URL
Click Connect.
Click Add Web Method.
Figure 3. Add Web method
Drag the following methods to the Design Surface:
GetChildCustomersForCustomer
GetCustomerIDs
GetCustomers
GetCustomerByID
Click OK.
Figure 4. Web methods added
In the LOB System Name dialog box, type SampleWebService in the LOB System Name field, and then click OK to create the connection to the Web service.
Figure 5. Create the connection to the Web service
Configuring the SampleWebService LOB System Settings
Next, configure the SampleWebService LOB system settings, such as the authentication mode and wildcard character settings.
To configure the SampleWebService LOB system settings
In the Metadata Objects pane, select the SampleWebService node.
In the Properties pane, type "$" in the WildCardCharacter field.
Note
The wildcard character is usually either the "$", "*", or the "%" character, depending on the LOB system.
Figure 6. Wildcard property
In the WsdFetchAuthenticationMode field, click PassThrough.
Figure 7. WsdFetchAuthenticationMode property
Configuring the Customer Entity Name and Identifier
Now you can configure the Customer entity for the SampleWebService LOB system.
To configure the Customer entity
Expand the SampleWebService node, and then expand the Entities node.
Select the Entity0 node.
Figure 8. Entity0 node
In the Properties pane, type Customer in Name field.
Note
The DefaultDisplayName field updates automatically as soon as you navigate from the Name field.
Figure 9. Entity Name property
In the Metadata Objects pane, expand the Customer node.
Right-click the Identifiers node, and then select Add Identifier.
Figure 10. Add identifier
In the Properties pane, type CustomerID in the Name field.
Figure 11. Customer entity identifier Name property
Select System.String for the Type field.
Figure 12. CustomerID Type property
Configuring the Customer Entity Methods
Next, configure the following Customer entity methods:
GetChildCustomersForCustomer
GetCustomerIDs
GetCustomers
GetCustomerByID
First, you map the method parameters for each method. Then add filters to the GetCustomerIDs method. Finally, you associate the method parameters with the filters.
To map the parameters for GetChildCustomersForCustomer method
In the Metadata Objects pane, expand the Methods node, and then expand the GetChildCustomersForCustomer node.
Expand the Parameters node, and then expand the custid node.
Select custid.
Figure 13. custid parameter
In the Properties pane, select CustomerID[Customer] from the Identifier list.
Figure 14. custid Identifier property
In the Metadata Objects pane, within GetChildCustomersForCustomerParameters node, expand the Return node, and then expand the second Return node.
Expand the Item node, and select CustomerID.
Figure 15. CustomerID parameter
In the Properties pane, select CustomerID[Customer] from the Identifier list.
Figure 16. CustomerID Identifier property
To map the parameters for GetCustomerIDs method
In the Metadata Objects pane, expand the Methods node, and then expand the GetCustomerIDs node.
Expand the Parameters node, then expand the Return node, and then expand the second Return node.
Expand the Item node.
In the Properties pane, select CustomerID[Customer] from the Identifier list.
To map the parameters for GetCustomers method
In the Metadata Objects pane, expand the Methods node, and then expand the GetCustomers node.
Expand the Parameters node, expand the Return node, and then expand the second Return node.
Expand the Item node, and then select CustomerID.
In the Properties pane, select CustomerID[Customer] from the Identifier list.
To map the parameters for GetCustomerByID method
In the Metadata Objects window pane, expand the Methods node, and then expand the GetCustomerByID node.
Expand the Parameters node, expand the id node, and then select id.
In the Properties pane, select CustomerID[Customer] from the Identifier list.
In the Metadata Objects pane, within GetCustomersByIDParameters node, expand the Return node, and then expand the second Return node.
Expand the Item node, and select CustomerID.
In the Properties pane, select CustomerID[Customer] from the Identifier list.
To configure the filters for GetCustomers method
In the Metadata Objects pane, expand the Methods node, and then expand the GetCustomers node.
Right-click Filters, and then click Add Filter.
Figure 17. Add Name filter for GetCustomers method
In the Properties pane, type Name for the Name field.
Figure 18. Name property for GetCustomers Name filter
In the FilterType field, select WildcardFilter.
Figure 19. FilterType property for GetCustomers Name filter
Repeat Steps 1-3; however, this time type Limit in the Name field.
In the FilterType field, select Equals.
Figure 20. FilterType property for GetCustomers Limit filter
To associate parameters with filters
In the Metadata Objects pane, expand the Methods node, and then expand the GetCustomers node.
Expand the Parameters node, and then expand the name node.
Select name.
Figure 21. GetCustomers name parameter
In the Properties pane, select Name from the FilterDescriptor list.
Figure 22. GetCustomers name parameter FilterDescriptor property
Repeat Steps 1-3 for the limit parameter.
In the Properties pane, select Limit from the FilterDescriptor list.
Creating Method Instances
Now you create the following method instances:
IDEnumerator method instance type for the GetCustomerIDs method
Finder method instance type for the GetCustomers method
Specific Finder method instance type for the GetCustomerByID method.
To create the GetCustomerIDs IDEnumerator method instance
In the Metadata Objects pane, expand the Methods node, and then expand the GetCustomerIDs node.
Right-click Instances, and then select Add Method Instance to open the Create Method Instance window.
Figure 23. Add method instance for GetCustomerIDs
In the Create Method Instance window, select Id Enumerator for Method Instance Type, and then click OK.
Figure 24. Select method instance type
In the Properties pane, type GetCustomerIDsInstance for the Name field.
Figure 25. GetCustomerIDs method instance Name property
To create the GetCustomers Finder method instance
In the Metadata Objects pane, expand the Methods node, and then expand the GetCustomers node.
Right-click Instances, and then select Add Method Instance to open the Create Method Instance window.
Select Finder for Method Instance Type, and click OK.
In the Properties window pane, type GetCustomersInstance for the Name field.
To create the GetCustomerByID Specific Finder method instance
In the Metadata Objects pane, expand the Methods node, and then expand the GetCustomerByID node.
Right-click Instances, and then select Add Method Instance to open the Create Method Instance window.
Select Specific Finder for Method Instance Type, and then click OK.
In the Properties pane, type GetCustomerByIDInstance for the Name field.
Creating Associations
Next, create the association for the GetChildCustomersForCustomer method.
To create the association
In the Metadata Objects pane, expand the Methods node, and then expand the GetChildCustomersForCustomer node.
Right-click Instances, and then select Add Method Instance to open the Create Method Instance window.
Select Association for Method Instance Type.
Select Customer for the Source Entity field.
Select the Return node for the Return TypeDescriptor field.
Figure 26. Create GetChildCustomersForCustomer method instance
Click OK.
In the Properties pane, type CustomerToChildCustomers for the Name field.
Figure 27. GetChildCustomersForCustomer Name property
Testing the Method Instances
Now you can test the method instances.
To test the CustomerToChildCustomers method instance
In the Metadata Objects pane, expand the GetChildCustomersForCustomer node within the Methods node, and then expand the Instances node.
Right-click CustomerToChildCustomers, and then select Execute to open the Execute window for the method instance.
Figure 28. Execute CustomerToChildCustomers method instance
Click the Search button or click anywhere in the Value field to open the Select Entity Instance window.
Figure 29. Execute CustomerToChildCustomers window
Select GetCustomerIDsInstance, and then click Next to display the first page of results.
Figure 30. GetCustomerIDsInstance method results
Select one of the CustomerID values returned in the results, and then click OK to return to the Execute window.
Figure 31. Select CustomerID
Click Execute to display the customer data associated with the CustomerID you selected.
Figure 32. CustomerToChildCustomers method results
Verify that the customer data that appears is for the CustomerID that you specified.
To test the GetCustomerIDsInstance method instance
In the Metadata Objects pane, expand the GetCustomerIDs node within the Methods node, and then expand the Instances node.
Right-click GetCustomerIDsInstance, and then select Execute to open the Execute window for the method instance.
Figure 33. Execute GetCustomerIDsInstance method
Click Next to display the first page of results and verify that CustomerIDs are displayed.
Figure 34. GetCustomerIDsInstance method results
Click Next to page through the results.
To test the GetCustomersInstance method instance
In the Metadata Objects window pane, expand the GetCustomers node within the Methods node, and then expand the Instances node.
Right-click GetCustomersInstance, and select Execute to open the Execute window for the method instance.
Figure 35. Execute GetCustomersInstance method
Enter the sample value A for the Name field.
Enter the sample value 2 for the Limit field.
Click Execute to display the results for the sample query.
The query should return no more than two results, and the first letter of the Name field value should be A.
Figure 36. GetCustomersInstance method results
To test the GetCustomerByIDInstance method instance
In the Metadata Objects pane, expand the GetCustomers node within the Methods node, and then expand the Instances node.
Right-click GetCustomerByIDInstance, and then select Execute to open the Execute window for the method instance.
Figure 37. Execute GetCustomerByIDInstance method
Enter a value, such as 1000 for the CustomerID field.
Click Execute to display the customer data for the CustomerID value that you entered.
Figure 38. GetCustomerByIDInstance method results
Exporting the LOB System Instance Metadata
After you confirm that the connection for the LOB system, along with the entities, associations, and methods, are configured correctly within the Business Data Catalog Definition Editor, you are ready to export the LOB system instance metadata to an application definition file.
To export the metadata
Select the SampleWebService node in the Metadata Objects window, and then click Export.
Figure 39. Export SampleWebService application definition
Save the file as SampleWebService.xml.
Figure 40. Save SampleWebService application definition file
Importing the Application Definition File into the Shared Services Provider
Next you import the application definition file into the Shared Services Provider (SSP).
To import the application definition file into the SSP
To start the SharePoint 3.0 Central Administration Web page, click Start, and then point to All Programs. Point to Microsoft Office Server, and click SharePoint 3.0 Central Administration.
In the left navigation pane, click the name of your SSP.
In the Business Data Catalog section, click Import application definition.
In the Import Application Definition page that opens, browse to SampleWebService.xml, select the file, and then click Open.
Click Import.
Click Browse, locate the file, and then double-click it.
Leave all other application definition settings with their default values, and then click Import.
Modifying an Existing Application Definition by using the Business Data Catalog Definition Editor
You can also modify the metadata in an existing application definition file by importing it into the Business Data Catalog Definition Editor. If you are modifying the application definition for an existing application in the Business Data Catalog, you must export the metadata file for the application definition from the SSP first.
Note
If you are modifying the application definition for an existing application in the Business Data Catalog, you must first either delete the original application in the Business Data Catalog or update the application version number before you import the application definition.
To export the application definition file from the SSP
To start the SharePoint 3.0 Central Administration Web page, click Start, point to All Programs, and then point to Microsoft Office Server and click SharePoint 3.0 Central Administration.
In the left navigation pane, click the name of your SSP.
In the Business Data Catalog section, click View applications.
In the Applications list, click the application name.
Click Export Application Definition to open the Export Application Definition page.
Click Export, and then click Save.
To import an application definition file into the Business Data Catalog Definition Editor and modify the metadata
On the Start menu, click Microsoft Business Data Catalog Definition Editor.
Click Import.
Browse to the location of the application definition file, select it, and then click Open.
After the LOB system data is loaded into the Business Data Catalog Definition Editor, you can make several changes to the LOB system instance, such as:
Changing the connection string
Changing the authentication mode
Adding or removing entities
Next Steps
After completing these tasks, you can configure Enterprise Search to crawl this content so that your users can search business data. For information about how to configure Enterprise Search, see Walkthrough: Configuring Search for the AdventureWorks Business Data Application Sample. For details about how you can customize the Search user interface this scenario, see Walkthrough: Add a Tab and Custom Search Page with Enterprise Search Web Parts to the Search Center.
Conclusion
The Business Data Catalog in Microsoft Office SharePoint Server 2007 enables you to integrate LOB data that is hosted outside of the portal into elements such as lists and Enterprise Search within Office SharePoint Server 2007. The Business Data Catalog requires a definition file with metadata that defines the connection to the external data source and identifies the data type that is being retrieved from the data source.
The Business Data Catalog Definition Editor automatically generates the XML metadata for the LOB system, making it easy to create an application definition file for the Business Data Catalog.
Additional Resources
For more information about the Business Data Catalog and Office SharePoint Server 2007, see the following resources: