在双向发送端口中使用CSV到XML的映射来轮询来自公共REST API的数据 [英] Using a CSV to XML map in a two-way send port that polls data from a public REST API

查看:156
本文介绍了在双向发送端口中使用CSV到XML的映射来轮询来自公共REST API的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的情况是这样的:

我需要使用Wcf-WebHttp适配器从REST API获取CSV数据,并使用我已部署的映射(连同CSV和XML架构)将此数据映射到XML,并将其存储在SQL Server数据库中./p>

到目前为止,我已经创建了一个双向发送端口,一个静态单向发送端口,一个接收端口和一个接收位置.

双向发送端口从API轮询数据,而静态的双向发送端口使用过滤器订阅该发送端口并接收数据.

我尝试将映射作为双向发送端口上的入站和出站映射,以及作为静态单向发送端口上的出站映射,但是没有发生任何转换.我简单地得到一个在根级别的数据无效.第1行,位置1."尝试传输数据时发出警告.

我也不确定应该为此使用什么管道.使用静态发送端口的一种方式是使用XML发送管道将数据正确发送到SQL Server数据库.

目前,接收位置仅在双向发送端口中触发GET请求.

双向发送端口

单向静态发送端口

解决方案

对于双向发送端口上的接收管道,您将需要具有一个平面文件反汇编程序的管道,该文件指向您要解析的CSV模式CSV转换成XML.然后,您可能会有一个入站映射,以将该XML转换为另一种XML格式.

如果双向发送端口针对REST API执行GET,则不需要出站映射(因为无论如何您都不会发送消息正文).

My situation is like this:

I need to get CSV data from a REST API using the Wcf-WebHttp adapter, map this data to XML using a map I have deployed (along with the CSV and XML schema) and store it in an SQL Server database.

For now I have created a two-way send port, a static one way send port, a receive port and a receive location.

The two-way send port polls the data from the API, and the static one way send port subscribes using a filter to this send port and receives the data.

I tried putting the map as an inbound and outbound map on the two-way send port, and as an outbound map on the static one way send port, but no transformation occurs. I simple get a "Data at the root level is invalid. Line 1, position 1." warning when attempting to transfer the data.

I am also unsure what pipelines I should use for this. On my one way static send port I have used an XML Transmit pipeline to correctly send the data to the SQL server database.

The receive location is only there to trigger the GET request in the two-way send port for now.

Two-way send port

One-way static send port

解决方案

For your Receive Pipeline on your Two-way send port, your will need to have a pipeline with a Flat File Disassembler that is pointing to your CSV schema to parse the CSV into XML. You would then possibly have an inbound map to transform that XML into another XML format.

You don't need a Outbound map if your Two-Way send port is doing a GET against the REST API (as you won't be sending a message body anyway).

这篇关于在双向发送端口中使用CSV到XML的映射来轮询来自公共REST API的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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