1

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

enter image description here

One-way static send port

enter image description here

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
Leth
  • 1,033
  • 3
  • 15
  • 40
  • 1
    If you are getting a CSV file, you would need to parse it using a pipeline containing a Flat File Disassembler which points to the CSV schema in the Receive Pipeline of the Two-Way send port – Dijkgraaf Sep 26 '18 at 08:00
  • Like @Dijkgraaf mentioned, use the Flat File Disassembler. Also enable tracking on the message you receive, so you can download that one and use it in the Flat File Wizard to create the CSV schema. – r3verse Sep 26 '18 at 14:01

1 Answers1

1

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).

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54