XML Validate Instance error

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › XML Validate Instance error

Viewing 0 reply threads
  • Author
    Posts
    • #21296

      Hi,

      I am generating an xml through a .Net application. This uses xmlwriter object to generate the xml file. Now I need to consume this message in my orch. The problem i face is if i validate the schema keeping the .Net generated file as input instance i run into erros.Do i need to take care anything while creating xml through .Net.

       

      Sample .net code I have used :

       

       

       

       

       

      XmlTextWriter xmlWrVendor = new XmlTextWriter(strXmlDest, Encoding.UTF8);

      xmlWrVendor.WriteStartDocument();

      xmlWrVendor.WriteStartElement(

      “ns0”,“Invoices”,“http://InvoiceIntegration.Invoices”

      );

      xmlWrVendor.WriteStartElement(

       

      “Invoice”

      );

      xmlWrVendor.WriteElementString(dsEmployeeData.Tables[0].Columns[0].ColumnName.Replace(

       

      ” “, “”

      ), dsEmployeeData.Tables[0].Rows[intCounter].ItemArray[0].ToString());

      My Schema :

       <?xml version=”1.0″ encoding=”utf-16″ ?>
      – <xs:element name=”InvTrans“>
      – <xs:complexType>
      – <xs:sequence>
      – <xs:element name=”Invoice“>
      – <xs:complexType>
      – <xs:sequence>
        <xs:element name=”Type“ type=”xs:string“ />
        <xs:element name=”Vendor“ type=”xs:string“ />
        <xs:element name=”VendorNo“ type=”xs:string“ />
        <xs:element name=”Site“ type=”xs:string“ />
        <xs:element name=”InvDT“ type=”xs:string“ />
        <xs:element name=”GLDT“ type=”xs:string“ />
        <xs:element name=”VoucherNo“ type=”xs:string“ />
        <xs:element name=”InvNo“ type=”xs:string“ />
        <xs:element name=”InvAmt“ type=”xs:string“ />
        <xs:element name=”Curr“ type=”xs:string“ />
        <xs:element name=”Narration“ type=”xs:string“ />
        <xs:element name=”PaymentCurr“ type=”xs:string“ />
        <xs:element name=”PaymentRtDT“ type=”xs:string“ />
      – <xs:element maxOccurs=”unbounded“ name=”InvLineItems“>
      – <xs:complexType>
      – <xs:sequence>
        <xs:element name=”Project“ type=”xs:string“ />
        <xs:element name=”Task“ type=”xs:string“ />
        <xs:element name=”ExpenditureType“ type=”xs:string“ />
        <xs:element name=”ExpenditureOrg“ type=”xs:string“ />
        <xs:element name=”EmpNumber“ type=”xs:string“ />
        <xs:element name=”ExpenditureDT“ type=”xs:string“ />
        <xs:element name=”PRNumber“ type=”xs:string“ />
        <xs:element name=”TDS“ type=”xs:string“ />
        <xs:element name=”WCT“ type=”xs:string“ />
        <xs:element name=”Amount“ type=”xs:string“ />
        <xs:element name=”Description“ type=”xs:string“ />
        <xs:element name=”TaxCode“ type=”xs:string“ />
        <xs:element name=”GLDate“ type=”xs:string“ />
        <xs:element name=”ExpItemDt“ type=”xs:string“ />
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        </xs:schema>

      Regards

       

      VJ

Viewing 0 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.