none
error while reading data from infopath forms.

    Question

  • 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

    Friday, January 18, 2008 10:23 AM

All replies

  • Hi Manish

     

    I get the same Error.

    Did you find a solution to the above issue.

     

    When I debug, I get the InitiationData in the workflowProperties, but the line throws a null exception.

    XmlTextReader reader = new XmlTextReader(new System.IO.StringReader(workflowProperties.InitiationData));

    Please let me know if you have any solutions.

     

    Thanks in advance

     

     

    • Proposed as answer by ssdeepanj Wednesday, September 17, 2008 9:31 AM
    • Unproposed as answer by Mike Walsh FIN Saturday, May 09, 2009 7:55 AM
    Thursday, April 10, 2008 1:04 PM
  •   If u have get the solution for this.Please send the answer .

    my Email ID is ssdeepanj@yahoo.co.in
    • Proposed as answer by ssdeepanj Wednesday, September 17, 2008 9:35 AM
    • Unproposed as answer by Mike Walsh FIN Saturday, May 09, 2009 7:55 AM
    • Edited by Mike Walsh FIN Saturday, May 09, 2009 7:55 AM Please urgent removed. These are Forums. Wait.
    Wednesday, September 17, 2008 9:33 AM
  • Hai Manish,

             Please help me.I am also working in workflow.I am also getting the same issue.How to solve this issue.Please send solution of this issue

    Thanks
    Deepan.J
    Wednesday, September 17, 2008 11:17 AM
  • For reference, I had this issue and it was simply because I renamed the class name of my xsd-generated file (but not my root infopath element) and so the Serializer couldn't map the new class name to the old root element name in my InfoPath form. See http://ddkonline.blogspot.com/2009/06/fix-there-is-error-in-xml-document-1-2.html

    Wednesday, June 03, 2009 4:24 PM