BDC Issue With Caching Configuration on the Autogenerated Web Service
KB000293
PRODUCT
Introduction
Error Resolution
![]() | Note: These changes will need to be manually applied to multiple front ends in a load balanced SharePoint farm |
- Locate the web service application folder on the SharePoint web front end. This location is typically found here:
C:Program FilesCommon FilesK2 BlackPearlBDC{SmartObjectName} - Navigate to CodeApp_Code directory
- Open Service.cs file
- Remove the call to Initialise_SmartObjectName() from the static Service method so it looks like this: static Service()
{
} - Locate the List declaration and make note of the smartObjectNames variable name // Dynamic K2AutoMetaData
private static List smartObjectNames = new List() ; - Locate the Initialise_SmartObjectName() method and add a .Clear() call for all the variables that match the information from step 5 so that they looks like this: // -- Dynamic K2AutoMetaData
private static void Initialise_TR7Employee()
{
smartObjectNames.Clear();
...
} - Add the Initialise_SmartObjectName() call as the first line in every “Get…” WebMethod for the web service. By default there are three of these as indicated here: public SmartObjectName[] GetSmartObjectNames(string name)
{
Initialise_SmartObjectName();
...
}
public SmartObjectName GetSmartObjectNameByID(string id)
{
Initialise_SmartObjectName();
...
}
public string[] GetSmartObjectNameIDs()
{
Initialise_SmartObjectName();
...
}
The web service will now bring back non-cached data.
![]() | Note: Although this workaround is not a high performance option, as it simply bypasses all caching code, it does ensure the latest data at all times. |