简体   繁体   English

带有EDI的JSON => XML / CSV / EDI / Txt

[英]JSON with EDI => XML/CSV/EDI/Txt

I'm trying to create a JSON structure for EDI. 我正在尝试为EDI创建JSON结构。 Input file will be EDI. 输入文件将为EDI。 i need to retrieve the EDI values via JSON and generate an user defined XML/EDI. 我需要通过JSON检索EDI值并生成用户定义的XML / EDI。

I see a json to json mapping in the link: http://www.altova.com/mapforce/json-data-mapping.html 我在链接中看到json到json的映射: http : //www.altova.com/mapforce/json-data-mapping.html

I don't need a mapping but i need to retrieve the EDI values and have the incoming EDI structure in JSON format. 我不需要映射,但是我需要检索EDI值并具有JSON格式的传入EDI结构。

Could someone please share your thoughts on the same? 有人可以分享您的想法吗?

Thanks in advance. 提前致谢。

Mapping is the way I use with Altova Mapforce. 映射是我与Altova Mapforce一起使用的方式。

First of all you can construct a mapping from EDI to XML and vice versa. 首先,您可以构建从EDI到XML的映射,反之亦然。 Then let Mapforce create the code for it eg in C Sharp. 然后让Mapforce为它创建代码,例如在C Sharp中。

Unfortunately a mapping from EDI to JSON in combination with the code generator is not supported in Mapforce. 不幸的是,Mapforce不支持从EDI到JSON以及代码生成器的映射。 So we have to do a little side step. 因此,我们必须采取一些小步骤。

You can use little helper tools like Newtonsofts JSON and convert the XML to a json array. 您可以使用Newtonsofts JSON之类的辅助工具,并将XML转换为json数组。 This will allow you to work with object structures in combination with EDI. 这将使您可以结合EDI使用对象结构。

In case you use the code generator from Mapforce the working order is like: 如果您使用Mapforce的代码生成器,则工作顺序如下:

EDI - XML - JSON to generate your json from an edi document EDI-XML-JSON,可从edi文档生成json

JSON - XML - EDI to generate your json to an edi document JSON-XML-EDI将您的json生成为edi文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM