Ask a questionAsk a question
 

AnswerWorkflow monitor Client via WCF

  • Tuesday, March 03, 2009 2:31 PMAlessandro Fiorencis Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello, I'm working on a tcp WCF client/server application, where my workflows are running on the server. I need to show on the client the instantiated workflow diagram (like in the WorkflowMonitor example) with checked the closed activities and marked the running activities. I've implemented the ViewHost on the client but to call the OpenWorkflow method I need the Workflowdefinition of the SqlTrackingWorkflowInstance. I've tried to pass the Activity in the ValueObject that I pass as result of my GetInstance method but I get the "generic" error "The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9960000' and "The read operation failed, see inner exception." as inner exception. I dig more and I find "An existing connection was forcibly closed by the remote host". Not very clear!

    The StackTrace says:


    Server stack trace:
       at System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
       at System.ServiceModel.Channels.SessionConnectionReader.Receive(TimeSpan timeout)
       at System.ServiceModel.Channels.SynchronizedMessageSource.Receive(TimeSpan timeout)
       at System.ServiceModel.Channels.FramingDuplexSessionChannel.Receive(TimeSpan timeout)
       at System.ServiceModel.Channels.FramingDuplexSessionChannel.TryReceive(TimeSpan timeout, Message& message)
       at System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    The only thing I can think of is that maybe System.Workflow.ComponentModel.Activity is not serializable so my DataContract is not valid.

    Can somebody tell me how to visualize the Workflow Monitor on the Client when the Workflow engine is running on the WCF server?

    Thanks
    Alessandro

     

Answers

  • Thursday, March 05, 2009 11:24 AMAlessandro Fiorencis Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Thank you, but I've just found a solution to my needs... I used a WorkflowMarkupSerializer to serialize the WorkflowDefinition in a String and pass the string over a WCF DataContract. It works and the designer on my client shows proudly the WF diagram. My only fear is the possible size of the serialized WF...

    Thanks
    Alessandro

All Replies

  • Wednesday, March 04, 2009 9:24 PMjdw - MSFT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    I don't believe that you are going to be able to pass the type in question through WCF - most WF types weren't intended for passing over the wire.  You may be able to simply pull the data that you need from the SqlTrackingWorkflowInstance and pass that over the wire instead or you could have the client use the SqlTrackingQuery api to query the database directly.

    Thanks,
    Joel
    This posting is provided "AS IS" with no warranties, and confers no rights
    • Proposed As Answer byjdw - MSFT Wednesday, March 04, 2009 9:24 PM
    •  
  • Thursday, March 05, 2009 11:24 AMAlessandro Fiorencis Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Thank you, but I've just found a solution to my needs... I used a WorkflowMarkupSerializer to serialize the WorkflowDefinition in a String and pass the string over a WCF DataContract. It works and the designer on my client shows proudly the WF diagram. My only fear is the possible size of the serialized WF...

    Thanks
    Alessandro
  • Friday, November 06, 2009 2:13 PMcoryng2000 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    Would you be able to share a sample code/pointers of you solution?

    Thanks!
    Cory