Infopath xsd and sharepoint workflow serialization problem
I exported the form code, ran "xsd.exe /c /l:vb mychema.xsd" which generated the appropriate class. I am using the following code to generate my class from the form data (extra lines removed for readability):
Public workflowProperties As SPWorkflowActivationProperties = New Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties
Public assocData As New AssociationData()
Private Sub codeActivity1_ExecuteCode(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim serializer As New XmlSerializer(associationData.GetType)
Dim reader As New XmlTextReader(New System.IO.StringReader(workflowProperties.AssociationData))
assocData = CType(serializer.Deserialize(reader), AssociationData)
The code executes fine and the assocData object is populated with correct values (viewed when debugging). The problem comes in when the workflow attempts to dehydrate and I get the following error in my sharepoint logs:
01/23/2007 15:42:16.30* w3wp.exe (0x1318) 0x0268 Windows SharePoint Services Workflow Infrastructure 72eo Unexpected ... Activity outerActivity, IFormatter formatter) at System.Workflow.ComponentModel.Activity.Load(Stream stream, Activity outerActivity) at System.Workflow.Runtime.Hosting.WorkflowPersistenceService.RestoreFromDefaultSerializedForm(Byte[] activityBytes, Activity outerActivity) at Microsoft.SharePoint.Workflow.SPWinOePersistenceService.LoadWorkflowInstanceState(Guid instanceId) at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.GetWorkflow(Guid instanceId) at Microsoft.SharePoint.Workflow.SPWinO...
...eHostServices.DehydrateInstance(SPWorkflowInstance workflow)
WinWF Internal Error, terminating workflow Id# 993849ac-f594-423b-be45-abfae4290112
Now, what seems really odd about this is that if I comment out this line "assocData = CType(serializer.Deserialize(reader), AssociationData)", the workflow properly (de)hydrates. Since this is an xsd generated class that should be serializable, I am starting to get frustrated. Any help you can provide would be greatly appreciated. Thanks.
Brad Aswegan

