Troubleshooting the Generic/Endpoint Service Types

Known Limitations

The endpoint service brokers cannot be used with the following:

  • Types that cannot be serialized by the Net Data Formatter. Objects support serializing and de-serializing of public and private fields of a class. To serialize a class, the class must have the Serializable attribute or implement the ISerializable interface.
  • Non-typed types.
  • Serialization of DataTables and DataSets. Their dynamic columns won't allow the creation of static return properties.
  • Classes that are dynamic in nature, such as DataTables and DataSets, cannot be used. This is due to the fact that the broker uses reflection to discover public properties based on the class definition. Other .NET and custom classes that are dynamic in nature are also not supported.

Troubleshooting Tips

  • If you are hitting an error when registering an instance (Web services or WCF) you can try to use a few Visual Studio tools to help. For WCF, WcfTestClient ("%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\WcfTestClient.exe") is best. It provides a nice visual way to test your WCF endpoint. If WcfTestClient has errors, service broker will as well. If you are working with Web services or want more details on WCF proxy generation, you can use the Visual Studio SVCUTIL utility to generate a proxy for the URL. If SVCUTIL has errors the endpoint service broker will too.
  • If you want to see the data coming back from the service in XML, turn off compression. Once you know how to deal with the data, you can update the instance again with compression set to true.
  • When using the SmartObject Services Tester tool and you’re deserializing a large amount of text, you need to click Edit and paste the results in the box so you don’t lose anything. Also check the top part of the paste to remove any ‘labels’ that aren’t part of the XML.
  • If complex data is returned, you may need to switch tabs to see the resulting XML

  • If you want to see how the service broker will interpret a particular type, you can use the WCFService project to replicate the source code and quickly test the results.
  • Always use the serialization and deserialization methods for the service instance you are working with. Trying to use methods and objects from a different service or service instance will fail most of the time.
  • If you want to configure the timeout for endpoints SmartObjects, or you get the error as shown below, follow the steps in the Resolution.

    Issue:

    You get the error: Object 'X' has been disconnected or does not exist at the server.

    Details:

    A timeout occurs when executing endpoints SmartObjects, such as those based on WCF, Web Services, and assemblies.

    Endpoint SmartObjects create their own appdomains that use an appdomain communcation channel when you execute a SmartObject method. When the lifetime of the channel expires, you get a timeout error. You can change a setting in the K2HostServer.config file to adjust the time the channel stays open waiting for a response, in minutes.

    Resolution:

    1. Stop the Server
    2. Add the attribute appdomainproxytimeout to <sourcecode.smartobjects.runtime node of the <install drive>:\Program Files\K2\Host Server\Bin\K2HostServer.exe.config file

    3. Specify your desired timeout in minutes.

    4. Start the server.