The BDC isn’t just limited to data located in a database, it’s most powerful feature is its ability to call webservices. I previously posted a brief description of the types of webservices are easily consumed by the BDC.
The key to easily calling webservices from the BDC first starts with an understanding of the types of methods that the BDC supports:
- Finder
- Specific Finder
- IDEnumerator
If we take the common example of getting customers from a webservice we might can start thinking about the way we create the webservice so that it doesn’t become a painful exercise.
The first method we should think about is something that can return the primary key (or ID) of our data:
So a method like:
GetCustomerIDs - This will return customer ID’s and will become our IDEnumerator
So the BDC will next need a method that will accept an ID that was returned by our GetCustomerIDs method above.
GetCustomerByID - This will become a Specific finder method, the naming ‘specific’ really gives the game away, it’s specifically returning data based on an ID.
The final method is a generic finder method that can be used by the Business Data List webpart:
GetCustomers – This becomes a finder method, we can have more of these methods with each one returning a different subset of data as needed.
It’s fairly easy to now create a BDC Application Definition File (ADF) using a tool like BDC Meta-Man. But you also need to remember that the ADF references a .NET assembly. This assembly is the proxy to the webservice, this proxy is the exact same proxy that we get automatically generated for us by Visual Studio when we add a web reference.
So you can create a proxy that will be used by the BDC, you just create a web reference in visual studio and compile that into a signed assembly and make sure the ADF references this assembly correctly.
Once you perform the two steps of creating the ADF and corresponding proxy classes, your well on your way to using the BDC via webservices.