This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I cannot seem to get the DistributedUnitOfWork Service to connect. I have the service exposed via and Svc file and running on the asp.net development web server. The code and exception message are detailed below. Any help you can provide would be much appreciated. Lightspeed version 5.0.2544.0 MyModelUnitOfWorkService.cs
MyModelUnitOfWorkService.svc
Client
ExceptionMessage "An internal exception occurred within the LightSpeed Distributed UnitOfWork Service" Server stack trace: at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Mindscape.LightSpeed.ServiceModel.IDistributedUnitOfWorkContract.Count(String typename) at Mindscape.LightSpeed.ServiceModel.DistributedUnitOfWork.CountTEntity at ConsoleApplication1.Program.Main(String[] args) in c:\Users\Greg.FS\Documents\Visual Studio 2012\DistributedLightSpeedTest\ConsoleApplication1\Program.cs:line 34 |
|
|
This will mean an exception is occurring with the UnitOfWork being used by the DistributedUnitOfWorkService. You can hook the GeneralFailureOccurred event on the DistributedUnitOfWorkService to get access to the underlying exception to work out what the problem is.
|
|
|
Thanks, I was able to figure out the issue using the GenealFailureOccurred event. I am now able to call the service. However, If I execute any operation that returns an entity I get the below error on the client side. It appears that simple scalar values such as counts are returned just fine though. Our entities are generated from a custom t4 template, I'm not sure if this has something to do with the issue. Client Code:
UserRoleMap.cs
The underlying connection was closed: The connection was closed unexpectedly. Server stack trace: at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWe bRequest request, HttpAbortReason abortReason) at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan time out) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, O bject[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, O bject[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntim e operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Mindscape.LightSpeed.ServiceModel.IDistributedUnitOfWorkContract.FindOne(String typename, Query query) at Mindscape.LightSpeed.ServiceModel.DistributedUnitOfWork.FindById[TEntity](Object id) at ConsoleApplication1.Program.Main(String[] args) in c:\Users\Greg.FS\Documents\Visual Studio 2012\DistributedLightS peedTest\ConsoleApplication1\Program.cs:line 32 |
|
|
Based on the exception I am thinking it sounds like a serialization issue - can you check if you can serialize the entities manually?
|
|
|
I got it figured out, it was a serialization issue. The T4 template I used did not have include any WCF serialization attributes on the entities which seems to be what was causing the exception. After I updated my templated to include the DataContract and DataMember attributes things started to work. Thanks for your help. |
|