EDI validation using c#
-
Saturday, April 14, 2012 6:00 PM
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
All Replies
-
Monday, April 16, 2012 4:11 AM
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.
- Edited by David K. Downing Monday, April 16, 2012 4:12 AM
- Marked As Answer by Lloyd ZhangMicrosoft Contingent Staff, Moderator Monday, April 23, 2012 3:19 AM
-
Monday, April 16, 2012 8:13 AM
Thanks David, I will try and let you know.
Venkat

