Ask a questionAsk a question
 

Questionerror while reading data from infopath forms.

  • Friday, January 18, 2008 10:23 AMManish.Parab Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    hi i,m developing workflow in sharepoint using VS2005

    i have attached a infopath in workflow form as an initiation form

    when i run the workflow i get the error saying There is an error in XML document (1, 2).

    this is a code which i,m using for getting the data from infopath.

    private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
            {
                workflowId = workflowProperties.WorkflowId;
                XmlSerializer serializer = new XmlSerializer(typeof(myfields));
                try
                {

                    XmlTextReader reader = new XmlTextReader(new System.IO.StringReader(workflowProperties.InitiationData));
                    myfields Associationfrm = (myfields)serializer.Deserialize(reader);
                    SPListItem myitem = workflowProperties.Item;
                }
                catch (Exception ex)
                {
                   
                    throw;
                }
              
            }


    when i debug the i get the InitiationData in the workflowProperties.InitiationData

    as

    <my:myFields xml:lang="en-US" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-01-16T10:47:10">
        <my:assignee>aa</my:assignee>
    </my:myFields>

    but
    XmlTextReader reader = new XmlTextReader(new System.IO.StringReader(workflowProperties.InitiationData));
    gives reader as None..

    and when debug next line it gives me error

    <myFields xmlns='http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-01-16T10:47:10'> was not expected.


    i,m stuck..
    plz help me out

All Replies