简体   繁体   English

解析从Web服务获取的数据的最佳实践是什么?

[英]What is the best practice for parsing data got from a web service?

I have got a web service (*.amsx) that I should call it within a SSIS package by service component. 我有一个Web服务(* .amsx),应该在SSIS包中按服务组件将其称为。

The web service returns some records and my mission is parsing every single record and do an appropriate action by looking at one of its fields (Action). 该Web服务返回一些记录,我的任务是解析每条记录,并通过查看其一个字段(动作)来执行适当的操作。 So If it contains value 'add' I should insert that record into my Database and if it contains 'edit', I should update its contents in my Database. 因此,如果它包含值“ add”,我应该将该记录插入到我的数据库中,如果它包含“ edit”,则应该更新它在数据库中的内容。

Now, my question is : Is there any best practice for such these scenarios when parsing data? 现在,我的问题是:解析数据时是否有针对此类情况的最佳实践?

In SSIS, do a dataflow where you get records from your source as the first part of the dataflow. 在SSIS中,执行数据流,从源中获取记录作为数据流的第一部分。 Next(within the same dataflow), do a condition split based on the value of the Action column you were referring to - this will parse your data into two separate flows - update, add/insert. 接下来(在同一数据流中),根据您要引用的Action列的值进行条件拆分-这会将您的数据解析为两个单独的流-更新,添加/插入。

For records that are to be inserted, do an oledb destination. 对于要插入的记录,请执行oledb目标。

For records that are to be updated, do an oledb command. 对于要更新的​​记录,请执行oledb命令。

All that should take place within a single dataflow. 所有这些都应在单个数据流中进行。 I would recommend including a check for the existence of the 'add' records (by key) in the destination before you insert so you don't get duplicates - that is if you would ever be running this package more than once. 我建议您在插入之前检查目标中是否存在“添加”记录(按键),这样就不会出现重复-也就是说,如果您将多次运行此程序包。

Anyway, that's the general idea. 无论如何,这是一般的想法。

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

相关问题 从不同客户端收集数据的最佳实践是什么? - What's the best practice to collect data from different clients? 从数据库表中删除数据的最佳做法是什么? - What is the best practice for delete data from database table? 安卓 什么是最好和最安全的数据存储方式(来自Web服务的更新) - Android. What is the best and safest way of storing data (updates from web service) 存储用户数据的最佳做法是什么? - What is best practice to store user data? 从 Web 服务中查找实时数据的最佳方式 - Best Way To Find Live Data From A Web Service 检索数据的最佳实践? SQL数据库与HTML解析 - Best practice for retrieving data? SQL Database vs HTML parsing JPA-从数据库查找表加载静态数据的最佳实践是什么? - JPA - What's the best practice way to load static data from a Database lookup table? 用默认数据填充sqlite数据库时的最佳实践是什么? - What's the best practice when populating a sqlite database with default data? 向客户端发送数据的最佳实践是什么:返回实体还是 dto? - What is the best practice for sending data to the client: returning an entity or a dto? 在数据仓库中表示时间间隔的最佳实践是什么? - What is best practice for representing time intervals in a data warehouse?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM