简体   繁体   English

BizTalk 2013R2 中的 JSON 到 XML 模式

[英]JSON to XML Schemas in BizTalk 2013R2

Working on developing a BizTalk 2013R2 solution that calls a REST API, returns data, transforms the data against a map and spits out a.csv on the other side致力于开发调用 REST API 的 BizTalk 2013R2 解决方案,返回数据,根据地图转换数据并在另一侧吐出 a.csv

There's a major hurdle I can't get around currently that I'd like to overcome;目前我想克服一个我无法绕过的主要障碍;

  • The API call returns the extract in JSON format. API 调用返回 JSON 格式的提取。 Whilst I can easily build a JSON decoding receive pipeline, the elements within the JSON extract are numerical, so I can't build an appropriate schema (example of element below) - which gives虽然我可以很容易地构建一个 JSON 解码接收管道,但 JSON 提取物中的元素是数字的,所以我无法构建一个合适的模式(下面的元素示例)——这给出了

Name cannot begin with the 'X' character, hexadecimal value名称不能以“X”字符开头,十六进制值

"412345": [
    {
        "LineID": 123456,
        "LineDescription": "This is a description",
        "Year": 2020,
        "Month": 1,
    },
    ...

Is there any way I can treat this element before it's picked up without any major code (eg can the element be automatically appended with a letter?)有没有什么办法可以在没有任何主要代码的情况下在拾取这个元素之前对其进行处理(例如,该元素可以自动附加一个字母吗?)

You would have to have another pipeline component that runs in the Decode section of the pipeline that would have to replace the first part of the message.您将必须有另一个在管道的解码部分中运行的管道组件,该组件必须替换消息的第一部分。

If the number changes for each message, rather than adding a letter to it you probably want to make it a value, rather than a name.如果每条消息的数字都发生变化,而不是向其添加一个字母,您可能希望将其设为一个值,而不是一个名称。

eg例如

Code: "412345",
Lines: [{
        "LineID": 123456,
        "LineDescription": "This is a description",
        "Year": 2020,
        "Month": 1,
    },
    ...

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

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