public static IDocumentPlug CreateGComDocumentPlug() { string path = "GComPO.xsd"; string targetNamespace = @"GCom_Schemas"; string name = "GComPO"; return(DocumentPlugFactory.CreateDocumentPlugFromXmlSchema(path, targetNamespace, name)); }
/// <summary> /// This function should be used only for unit testing where we don't want to connect to Azure storage /// </summary> /// <param name="currentTransactionSetType"></param> /// <returns></returns> public static IDocumentPlug CreateEDIDocumentPlug(int currentTransactionSetType) { string path, targetNamespace, name; switch (currentTransactionSetType) { case 820: path = "820-R1.xsd"; targetNamespace = @"urn:x12:schemas:005010X306:820R1:HealthInsuranceExchangeRelatedPayments"; name = "X12_005010X306_820R1"; break; case 850: path = "GCommerce.EDI._00401._850.Schemas.Enriched_X12_00401_850"; targetNamespace = @"http://schemas.microsoft.com/BizTalk/EDI/EDIFACT/2006/EnrichedMessageXML"; name = "X12EnrichedMessage"; break; case 277: path = "X12_005010X214_277B3.xsd"; targetNamespace = @"urn:x12:schemas:005:010:277B3:HealthCareInformationStatusNotification"; name = "X12_005010X214_277B3"; break; case 810: path = "X12_00501_810.xsd"; targetNamespace = @"http://schemas.microsoft.com/BizTalk/EDI/X12/2006"; name = "X12_00501_810"; break; default: throw new Exception(string.Format("{0} schema not found", currentTransactionSetType)); } IDocumentPlug schemaPlug = DocumentPlugFactory.CreateDocumentPlugFromXmlSchema(path, targetNamespace, name); XElement schemaXml = schemaPlug.SerializeToXml(); schemaXml.Save(string.Format("Schema_{0}.xml", currentTransactionSetType)); return(schemaPlug); }