It isn’t that hard to create a flat file from XML file, but I had a bit of trouble to find out how to create a header line with the column names, so I thought I would write a short blog post to describe this.
The following steps are needed:
- Take a copy of your flat file schema. Remember to change the file name and type name of the schema
- Open the new schema and change the name of your root element or your target namespace. Otherwise you will get an error that BizTalk can’t find your schema as it might not have been added to the GAC. The reason for this error is that BizTalk needs a unique combination of target namespace and root element.
- For each element in your schema you have to set a default value (the name of the column) and it needed change the datatype of the element to string.
- In the send pipeline flat file assembler component you have to point this new schema that you have created.
- This should be it. Of cause you need to deploy, restart and so on, but you know this 😉
Now you have a flat file with header column names as some systems like.