I was asked to process a X12 document from an SFTP server which will have multiple GS/ST segments. So I decided to use Logic Apps with Enterprise Integration Pack. I've handled flat files before, but this solution will require me to use the X12. So I got to the point of adding the schemas to the Agreement, but it says there are "No schemas found". I assume by this message, it's not allowing me to use the flat file schema I uploaded. I can't find any documentation on this, other than how to upload, update and delete a schema file. What schema format should I be using for the agreement? Are they available anywhere?
4 Answers
The file "format" must match. I "believe" it validates header information and/or character set used. They should match the X12's that come with BizTalk. If you need to do a custom version, like modifying a field to allow a larger string size or change the order of segments, do the following:
- Make a copy of the original X12 schema.
- Rename it to be unique, like changing X12_00401_940.xsd to X12_00401_940_Custom.xsd.
- Customize the field(s)/segment(s) as needed.
The key is character set used in the file and the header information. Make sure to preserve those.
The X12 Agreement would only recognize the schemas that come with BizTalk. The Logic App's Agreements would not recognize "homemade" schemas.
I eventually found where I can get the BizTalk schemas. Here is what you can do to get it:
How to Install EDI Schema Files
What I did was
- create a Windows 2016 VM
- install VS 2013
- install BizTalk 2013 R2 Evaluation
- copy the file from C:\Program Files (x86)\Microsoft BizTalk Server 2013 R2\XSD_Schema\EDI\MicrosoftEdiXSDTemplates to my local machine
- run the executable on my machine
FYI: This executable stopped being available with free versions of BizTalk starting with 2016. This is why I used 2013 R2.
There were some subtle differences between these schemas and the ones the Schema Editor created.
BizTalk schemas had:
<xs:schema xmlns:btsedi="http://schemas.microsoft.com/BizTalk/2005/EdiSchemaEditorExtension" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://schemas.microsoft.com/BizTalk/EDI/X12/2006" targetNamespace="http://schemas.microsoft.com/BizTalk/EDI/X12/2006" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
The SDK Schema Editor created:
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:xs="http://www.w3.org/2001/XMLSchema">
The BizTalk schemas had extra attributes. They had:
- targetNamespace="http://schemas.microsoft.com/BizTalk/EDI/X12/2006"
- xmlns:btsedi="http://schemas.microsoft.com/BizTalk/2005/EdiSchemaEditorExtension"
Also to note, the Editor would create the first element as Root, and I believe the X12's wanted a very specific name in the format: X12_{veriosn}_{TransactionSet}. Also the X12 were UTF-8, whereas the Editor created UTF-16.
I am new to BizTalk and its VS2015 centric rquired view of the world. There is an Azure Template that has almost all the BizTalk items:
BizTalk Server 2016 Developer
- SQL Serer
- BizTalk Server
- Visual Studio 2015
- BizTalk SDK (minus EDI Schemas)
Schemas are located in the Microsoft Azure BizTalk Services SDK Setup in the MicrosoftEdiXSDTemplates.zip (including X12) file.
Note Microsoft open sourced the schemas but had to remove the X12 schema because they were not open source.