JSON提取到XML目标(Kingswaysoft) [英] JSON Extract to XML destination (Kingswaysoft)

查看:73
本文介绍了JSON提取到XML目标(Kingswaysoft)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我一直很沮丧尝试使用Kingswaysoft组件来解决这个问题。他们似乎很难处理,而且根本不灵活,但我希望这是因为我还是新手。


我正在使用JSON源组件来读取JSON文件,以及用于创建XML文档并将其发送到Web服务的XML目标。


我正在读取JSON产品订单并将数据提取到列中。 即2个输出列: 



1。根顺序 - 复杂元素: 包含一般订单信息


2。 Orderlines - (Array) - RepeatingComplexElement:包含Orderlines数组中的元素,即每个产品系列。



我的问题:


1。


Root Order输出具有JSON值"Currency",我需要将其映射到XML元素"CurrencyCode"。但输入列"货币"此CurrencyCode元素不可用,因为它属于"根顺序" - 输入。
我无法从下拉列表中选择它。 


更改JSON订单结构实际上不是一个选项,所以我能想到的唯一其他解决方案,是将整个过程分成几个DataFlow任务并使用变量。但对于一件简单的事情来说,这似乎是一个丑陋的解决方案。 



2。


我有另一个JSON值"数量"我需要映射到2个不同的XML元素。但我只能在XML目标组件中使用输入列"数量"一次。 我通过将JSON值复制到
a Premium Derived Column中的新列,并将此新列分配给XML目标中的其他Quantity字段来解决此问题。它似乎工作正常,但我想知道是否有更好的方法?



提前多多谢谢!








解决方案

Hello YonniBoi, 


有关Kingswaysoft组件的支持,请参阅  Kingswaysoft Support&服务。 


或阅读他们的博客  


So I've been frustrated trying to solve this problem using the Kingswaysoft components. They seem quite rigid to work with and not at all flexible, but I'm hoping it's because I'm still a novice.

I'm using the JSON source component to read from a JSON file, and an XML destination to create an XML-document and send it to a web service.

I am reading from a JSON product order and extracting the data into columns.  Namely 2 output columns: 

1. Root Order - Complex Element:  Contains general Order information

2. Orderlines - (Array) - RepeatingComplexElement: Contains the elements in the Orderlines-array, namely each product line.

My problems:

1.

Root Order output has a JSON-value "Currency", that I need to map into an XML-element "CurrencyCode". But the Input-column "Currency" is not available to this CurrencyCode-element, as it belongs to the "Root Order"-input. I can't choose it from the dropdown list. 

Changing the JSON-order structure is not really an option, so the only other solution I can think of, is to split the entire process up into several DataFlow-tasks and use variables. But it seems like such an ugly solution, for a simple thing. 

2.

I have another JSON-value "Quantity" that I need to map to 2 different XML-elements. But I can only use the Input-column 'Quantity' once in the XML destination-component.  I worked around this by copying the JSON-value into a new column in a Premium Derived Column, and assigning this new column to the other Quantity field, in XML destination. It seems to works fine, but I was wondering if there was a better way?

Thanks a lot in advance!



解决方案

Hello YonniBoi, 

For the support on Kingswaysoft components, please refer to Kingswaysoft Support & Services

Or reading their Blogs


这篇关于JSON提取到XML目标(Kingswaysoft)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆