Unable to register/refresh OData service instance in K2
kbt157708
PRODUCTIssue
You may experience various issues when trying to register/refresh the OData service instance in K2.
Symptoms
When trying to register/refresh OData service instance in K2 you may receive the following errors:
1. "VALIDATIONThe ‘Name’ attribute is invalid 0 The value ‘%Attribute_Name% ’ is invalid according to its datatype ‘http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier’ – The Pattern constraint failed. "
2. SmartObject Server Exception: Error refreshing Service Instance ‘%SI_Name%’. Service returned: ‘Compile Error: CS0013 – Unexpected error writing metadata to file ’%AppData%LocalTemp%SI_Name%’ – ‘No logical space left to create more user strings.’
Troubleshooting Steps
1. This error is not thrown by K2 but by EntityClassGenerator which K2 uses to generate the assembly code, the same errors can be seen in Visual Studio. The rules for the naming convention will be the same as for creating attributes in a C# class etc.
2. This error occurs when the assembly is too large with strings as per .Net limit. You can try and split the OData assembly in two - the K2 Documentation reflects the following:
In this particular case, the service provider has lots of other API options and can likely be consumed via Swagger and K2 REST broker when the OData broker does not work.