cancel
Showing results for 
Search instead for 
Did you mean: 

Files with same main node but different file names

former_member296836
Participant
0 Kudos

Dear all,

via FTP/FILE adapter I need to read 4 different files with different file names from a FTP server.

Unfortunately they all started with the main node named INFO but got different structures under this.

I am not able to create 4 different data types with name INFO.

Is there any other possibility to have different structures to start with same node?

Only solution I see:
- Create one big data type that include all possible subnodes. That would be tricky, because some subnodes

  got same name as well

- Create an own namespace for all data types.

 

Thanks
Chris

Accepted Solutions (1)

Accepted Solutions (1)

RaghuVamseedhar
Active Contributor
0 Kudos

Christian,

I think, you want to pick all 4 XML files with single sender channel. In that case create a single Data Type (with all fields from 4 files).

Let's say file1

INFO

field1

field2

field3

field4

Let'say file2

INFO

field1

field3

field5

Then create a Data type (no need to repeat common fields, XSD does not allow same field name in a level)

INFO

field1

field2

field3

field4

field5

Note when you create DT, MT in a namespace (MT with name INFO). It will have namespace details in root node.

<?xml version="1.0" encoding="UTF-8"?>

<ns0:INFO xmlns:ns0="urn:company:something">

former_member296836
Participant
0 Kudos

Hi Raghu,

thanks for your answer. This is the way I was thinking of, but it is not possible because there are a subsegment in two files that have the same name, but different fields.

I didn't check if I am able to create two segments with same name but different subfields, but I am not the meaning that this would be a good idea because of confusion.

I am just using different namespaces now and put the INFO data types in it.

Thanks for your help.

Answers (2)

Answers (2)

Harish
Active Contributor
0 Kudos

Hi Chris,

If you have different file name then you can create 4 different data type, message type and service interface. The possible scenario is:

Configuration

  • 4 communication channel to pick different files (having different names)
  • 4 ICO/sender agreement with 4 interfaces

ESR

  • 4 service interface for each file
  • 4 message type for each file
  • 4 data type for each structure

you can use the canonical data model approach to min. the effort in data type. you can create the similar/same sub structure into one data and each main data type will refer to sub data type.

for canonical data model refer the below thread

regards,

Harish

Muniyappan
Active Contributor
0 Kudos

you could try below approach. Based on your structure, it will call the correct interface.