Validate EDI (XML, Edifact and Ansi X12)
Site
Functionality
- Multiupload
- No data is stored on the server
- MIME type is detected based on file content
- It is possible to upload without file extensiom
- All other files than text (edifact / ansi x12) or xml are skipped / not supported
- Validate structure (eg schema validation)
- Validate business logic (eg schematron validation)
- XSLT Styling, readable document in HTML
- Calculate content and compare with values in eg an invoice
Milestones
Current task
- Scoped the project, only a few XML and EDIFACT versions will be implemented
- OIOUBL (danish adaption of the UBL standard)
- Peppol BIS
- Standard eg EDIFACT D96 are considere in a limited version as a start as a proof of concept
- cXML and xCBL are a possibility
- Store validation classes / objects in memory cache to use on subsequent requests
- XSLT transformations uses SaxonHE
- All stylesheet versions are supported
- Included stylesheets or XML documents are supported
- Documentation of source code (XML documentation)
- SandCastle is used to generate HTML or MD documents
- Add content documentation to source code
Release
- WIP
- Jun 23: Only local test / development atm, date for a first beta release not estimated
- Oct 23: Slow process with local test / development, getting closer to a beta release
- Dec 23: Testing, prepare for release on VPS with Ubuntu
- Jan 14: Project running on VirtualBox / Ubuntu 23.10 / NET 8
- NGINX as Reverse Proxy in fron of Kestrel web server
- Jan 14: Test memory usage to validate 8 Gb mem limit
- Jan 23: Released on https://www.validatefile.dk
- VPS with 2 CPU, 8 Gb mem running Ubuntu 23.10 server and .NET 8
- Feb 07: Small adjustment, preparation for xCBL and cXML validation, About page added
To do list for project:
- Create Edifact Icon in SVG
- Tools needed:
- Inkscape SVG editor
- Fontforge: Create WOF2 package
- Validate file content
- Additional upload for schematron valditation, styling and calculation:
- Document examples from Pagero:
- Document styling
- Display XML content on web page: (Done)
- Edifact example source / projects
- favicon (Done)
- Popup window with validation messages (Abandoned)
- Milliseconds elapsed (Done)
Sandcastle
Use local postman for testing?
Unit test
Check for vulnerability
GDPR (mostly done)
Information or questions: Please contact plykkegaard at gmail dot com
Edit IDOC document properties
Once the IDOC definition is imported in the Mapping Designer make sure to set Max Occurences on the document root (DC1)
Use unlimited (-1) or 9999
- IDOCs are send from SAP to a queue with append
- File is read and mapped to edifact
- The transaction set header is set in New Mapping and the footer in Mapping End as found in the additional programs (tpå of source message)
- For each document / message you can use New Message and Message End

An utillity to get a random UUID
This is a procedure to use in Seeburger BIC Mapping Designer
/* -----------------------------
Peter Lykkegaard, 25 apr 2023
-----------------------------
procedure getUUID
Parameters:
None
Output
String
Create random UUID
----------------------------- */
#importJavaStart
import java.util.UUID;
#importJavaEnd
local output%;
#javastart
_StrVar_OUTPUT.setString(UUID.randomUUID().toString());
#javaend
exitProc(output%);
Unable to load project or solution in Visual Studio 2022
Windows 10
After updating Visual Studio you are no longer able to load source files in your solution
Error message: Load failed, the project file cannot be loaded
The update has messed up you path settings as you have both 64bit and 32bit version of dotnet running
In the environment settings / system variables move the <drive>\program files\dotnet 64bit path above the <drive>\program files (x86)\dotnet 32bit path
Save and you are ready to use VS 2022 after having updated the platform to latest version
Open Control panel -> System and the Advanced System Settings

Choose Environment Variables

In System Variables edit the Path settings

Move the 64 bit dotnet path above the 32bit path

When done click Ok and restart VS 2022

C# .NET Core 6: Get rootname, namespace or DTD using xmlreader
using (var stream = new MemoryStream())
{
FormFile?.CopyTo(stream);
stream.Seek(0, SeekOrigin.Begin);
var settings = new XmlReaderSettings()
{
// Parse file but do not reolve
DtdProcessing = DtdProcessing.Parse,
XmlResolver = null
};
using (var reader = XmlReader.Create(stream, settings))
{
var done = false;
while (reader.Read() && !done)
{
// something weird happened, bail out
//if (reader.EOF)
// return;
switch (reader.NodeType)
{
// Assume cXML
case XmlNodeType.DocumentType:
DocumentType = reader.GetAttribute("SYSTEM") + "";
break;
case XmlNodeType.Element:
switch (reader.LocalName)
{
// Assume an UBL dpcument of some kind
case "CustomizationID":
reader.Read();
SetCustomization(reader.Value);
break;
// Only OIOUBL, done and exit
case "UBLlVersionID":
reader.Read();
UblVersion = reader.Value;
done = true;
break;
// Only OIOXML, done and exit
case "TypeCode":
reader.Read();
TypeCode = reader.Value;
done = true;
break;
default:
if (string.IsNullOrEmpty(RootName))
{
RootName = reader.Name;
SetNamespace(reader.NamespaceURI);
}
break;
}
break;
}
}
reader.Close();
}
}