Skip to main content


 

Symptoms

 


You use custom broker and SmO returning a list of objects containing a Date. When it is being called as REST it ends up in an exception:
 

 
 
<?xml version="1.0"?><Fault xmlns="http://schemas.microsoft.com/ws/2005/05/envelope/none"><Code><Value>Receiver</Value><Subcode><Value xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</Value></Subcode></Code><Reason><Text xml:lang="de-DE">Object of type 'System.DateTime' cannot be converted to type 'System.String'.</Text></Reason><Detail><ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><HelpLink i:nil="true"/><InnerException i:nil="true"/><Message>Object of type 'System.DateTime' cannot be converted to type 'System.String'.</Message><StackTrace> at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast) at System.Reflection.MethodBase.CheckArguments(Objectb] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig) at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Objectb] parameters, CultureInfo culture) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Objectb] parameters, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Objectb] index) at SourceCode.Endpoint.Server.K2SmartObjectOperationInvoker.InvokeRest(Type instanceReturnType, Objectb] inputs, String connectionString) at SourceCode.Endpoint.Server.K2SmartObjectOperationInvoker.Invoke(Object instance, Objectb] inputs, Objectb]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace><Type>System.ArgumentException</Type></ExceptionDetail></Detail></Fault>
 

 

 

Diagnoses

 


This is known issue (internal ID 548057): "K2Blackpearl REST: Object of type 'System.DateTime' cannot be converted to type 'System.String' on SMO Services when returning data type of DATE" There is no ETA for the fix at the moment and issue is present in all current releases (including upcoming 4.7 release).
 

 

Resolution

This is known issue. Please log K2 Support Ticket in case you run into it have this logged and confirm possibility of getting this fixed.

 

 



 
Be the first to reply!

Reply