none
EDI validation using c# RRS feed

  • Question

  • Hi All,

    I have a orchestration which transforms my custom source format to EDI 837p format. I want to validate the EDI and log the errors in database table using a class library. I believe i need to send the EDI xml to the class library method and validate the xml with the EDI schema. Please let me know how to do this task.

    Thanks,

    venkat

    Saturday, April 14, 2012 6:00 PM

Answers

  • The following shows a sample using an eventing validator: http://msdn.microsoft.com/en-us/library/ms162371.aspx

    If you add a reference to the BizTalk project that contains the schema, you can access the schema as a string as follows:

    using System;
    using System.IO;
    using System.Text;
    using System.Xml;
    using System.Xml.Schema;
    using System.Xml.XPath;
    using BizTalk_Server_Project1;
    
    namespace SchemaAccess
    {
        public class Class1
        {
            public Class1()
            {
                FlatFileSchema ffSchema = new FlatFileSchema();
                XmlSchema schema = XmlSchema.Read(new StringReader(ffSchema.XmlContent), myEventHandler);
    
                XmlReaderSettings settings = new XmlReaderSettings();
                settings.Schemas.Add(schema);
    
                // refer to sample link
            }
        }
    }


    David Downing... If this answers your question, please Mark as the Answer. If this post is helpful, please vote as helpful.


    Monday, April 16, 2012 4:11 AM

All replies

  • The following shows a sample using an eventing validator: http://msdn.microsoft.com/en-us/library/ms162371.aspx

    If you add a reference to the BizTalk project that contains the schema, you can access the schema as a string as follows:

    using System;
    using System.IO;
    using System.Text;
    using System.Xml;
    using System.Xml.Schema;
    using System.Xml.XPath;
    using BizTalk_Server_Project1;
    
    namespace SchemaAccess
    {
        public class Class1
        {
            public Class1()
            {
                FlatFileSchema ffSchema = new FlatFileSchema();
                XmlSchema schema = XmlSchema.Read(new StringReader(ffSchema.XmlContent), myEventHandler);
    
                XmlReaderSettings settings = new XmlReaderSettings();
                settings.Schemas.Add(schema);
    
                // refer to sample link
            }
        }
    }


    David Downing... If this answers your question, please Mark as the Answer. If this post is helpful, please vote as helpful.


    Monday, April 16, 2012 4:11 AM
  • Thanks David, I will try and let you know.

    Venkat

    Monday, April 16, 2012 8:13 AM