Patrick's Bytes

28, July 2008

Workflow Services error: "Operation is not implemented by the service"

Filed under: WCF,Windows Workflow Foundation — patrickyong @ 2:55 am

I been trying to solve this Workflow Services error on my IssueTracker project for 2 weeks without any progress. 😦

Operation is not implemented by the service.
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)\r\n   at

System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)\r\n   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)\r\n   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)\r\n   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)\r\n\r\nException rethrown at [0]: \r\n   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n   at IssueTrackerTest.IssueProcessService.IIssueProcess.ProcessIssue(Issue issue)\r\n   at IssueTrackerTest.IssueProcessService.IssueProcessClient.ProcessIssue(Issue issue) in C:\\Workspace\\Projects\\IssueTracker\\IssueTrackerTest\\Service References\\IssueProcessService\\Reference.cs:line 285\r\n   at IssueTrackerTest.IssueProcessTest.TestProcessIssue() in C:\\Workspace\\Projects\\IssueTracker\\IssueTrackerTest\\IssueProcessTest.cs:line 88″    string

 

Until today I found this blog post by Damir Dobric.

While invoking an operation on the workflow’s web service you may get following error:

“Operation is not implemented by the service.”

To solve the problem take a look on the ContextToken property of the receive-activity of the workflow service.
If this property is set as shown on the picture below, remove the value, rebuild solution and start all again.

image

 

Thanks Damir for saving my days 🙂

19, June 2008

Workflow Foundation and LINQ2SQL: Of BinaryFormatter and DataContractSerializer

Filed under: LINQ to SQL,Windows Workflow Foundation — patrickyong @ 12:44 am

There seem to be quite a lot of questions in forums and blog post about inability of have LINQ to SQL object in a Workflow Foundation’s Activity execution. Most of the time, you will end up getting a error message as below

Type ‘System.Data.Linq.ChangeTracker+StandardChangeTracker’ in Assembly ‘System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ is not marked as serializable.

After I did some research and found out about serialization method in LINQ to SQL here:

http://msdn.microsoft.com/en-us/library/bb386929.aspx

Code generation in LINQ to SQL supports DataContractSerializer serialization. It does not support XmlObjectSerializer or BinaryFormatter. For more information, see Serialization (LINQ to SQL).

However for Workflow Foundation, it is using BinaryFormatter to serialize objects into persistent layer (refer the MSDN document here)

When the workflow runtime encounters a persistence point during workflow instance execution, it calls the persistence service to do the work. The persistence service will then serialize the workflow state into a stream using BinaryFormatter serialization, optionally compress it, and save it into a durable store.

As such there is a crash here which renders LINQ to SQL entities can’t be used in Workflow Foundation. Fortunately Serena Yeoh found a solution and put it into her project at Layer Sample. You can found out more at this forum thread. Basically her code will take LINQ to SQL objects, clone it and serialize it using DataContractSerializer first before committing changes. Then after that it will return the cloned copy.

24, April 2008

BizTalk 2006 R3 details released

Filed under: Biztalk,Workflow — patrickyong @ 2:04 pm

Steven Martin posted on his blog that the next version of BizTalk Server will be BizTalk 2006 R3. You can get more info from his blog. But it doesn’t seem like the BizTalk vNext that people talk about with integration of Windows Workflow Foundation. That could just maybe happen in Oslo timeframe?

http://blogs.msdn.com/stevemar/default.aspx

Will be released in calendar year 2009 and since it will support .NET Framework 3.5 I guess development will be done on Visual Studio 2008.

Those keen to check out how latest version of BizTalk helps to realize the SOA vision can apply for beta testing at http://connect.microsoft.com

17, January 2008

VSTO Reloaded

Today the MSE team did a Tech Preview to fellow developers on Visual Studio 2008 which actually available for MSDN subscribers late last year and is available for sales now.

My session is about Visual Studio Tools for Office (VSTO) 2008 and a lot of productivity enhancements have been put inside the package in this current version. They include but not limited to:

  1. Better UI Development on Office UI
    • Form Regions in Outlook
    • Custom Task Pane
    • Custom Ribbon for Excel, Word and PowerPoint.
    • No relearn, leverage on Windows Form Development skill
    • Windows Form able to host WPF app and extends this capability via Custom Task Pane
  2. SharePoint Workflow development
    • No more manual writing of workflow.xml, feature.xml (both are SharePoint feature config files) and deployment script
    • Streamline development process from 15 steps to 3 steps in VSTO 2008
  3. Word Content Control data binding with VSTO addin
    • Bringing unstructured data from Word documents to a structured world
    • Able to attach custom XML such as RosettaNet or UNeDoc which as industry based XML schema to Word data.
  4. Easy deployment of VSTO – Office Addin via Click Once
    • No more reliant on CASPOL
    • Transparent to end users

vstodemo

I demo a cool VSTO addin for Word 2007 hosting a WPF user control with colossal effect and acting as a client to a WCF services at the back end. The data access is done using LINQ for XML. After that I will publish

It is based on an article in MSDN Dec 2007 issue but the source codes there is not working for RTM version of VS 2008. Many thanks for fellow MS staff Andrew Whitechapel for making it work for VS2008 RTM.

You can download the slides and working version of the source code here. They are hosted on Windows Live Skiydrive/ Folders.

Slides in PDF

Slides in XPS

Source Code in C#

I will come out with a tutorial for the SharePoint Workflow later and also a VB9 version of the source code. So stay tuned. 🙂

29, April 2007

Hosting Windows Workflow Foundation in a NT/Windows Service

Filed under: Workflow — patrickyong @ 4:56 pm

People have been asking me about ideas to host WF outside of Sharepoint and IIS, maybe its because for security purposes and infrastructure constrant, so this is one fine example how WF found its way to Windows Services.

Link to Sometimes I Wonder… » Hosting Windows Workflow Foundation in a NT/Windows Service

17, November 2006

WF Act and App Samples

Filed under: Workflow — patrickyong @ 5:56 pm

The WF team in Redmond has released a zip file of sample workflow applications and activities. Some of them incl:

  1. OutlookWorkflow App
  2. Speech Workflow App
  3. Active Directory Roles
  4. User Track Points
  5. Email sending Activity
  6. File Monitor Activity

You can get it here.

11, November 2006

Performance Characteristics of Windows Workflow Foundation

Filed under: Workflow — patrickyong @ 2:16 pm

People who is currently using other or develop their own workflow engine will be curious on how Windows Workflow Foundation (WF) fair in performance test. This white paper the performance of WF under different workflow instance scenario.

 http://msdn2.microsoft.com/en-us/library/Aa973808.aspx

Create a free website or blog at WordPress.com.