Discussion:
DAX 4.0 - Aif: only xml-format possible for outbound file?
(too old to reply)
Patrick Fiala
2010-06-17 10:46:12 UTC
Permalink
Hi,

I currently have the task to implement the export of data with Aif in
a 4.0-environment. Bascically no problem, however my process has to
create csv-files. The Aif creates xml-files in the firstplace, however
it is possible to modify the resultfile by a xslt-transformation in
the pipeline. So I've created a xslt-file which transforms the
xml-file resulting from the first step to a csv-file. When I add this
xslt-file as pipeline to my Aif process I get the errormessage "Data
at the root level is invalid. Line 1, position 1". My subsequent
investigations gave the result that the file finally created by the
Aif (after eventually executed steps in the pipeline) has to be a
valid xml-file. That would mean, that it isn't possible to create a
plain text-/csv-file with the Aif itself. For that an additional step
would be necessary which couldn't be executed within the
Aif-framework. Is this really the case or is there any possibility to
create a csv-file with the Aif and which I haven't found?

Regards
Patrick
Axel Kühn
2010-06-17 18:06:09 UTC
Permalink
Hi Patrick,

it is possible to export data into a csv file with AIF. But it is not
possible with the standard of Dynamics AX.

Because of the reason that the only place were you have access to the "full"
xml file/document is the transportadapter, you have to write a new transport
adapter.

When you try to use a pipelinecomponent you only have access to the body
part of the generated xml document, not to the header. The header get created
befor the xml message is routed to the transport adapter.

Its not so hard to write a new adapter, because you can reuse many parts of
the existing filesystemadapter (classes AifFileSystemAdapter and
AifFileSystemSendAdapter). I.e. in the writefile method of your new adapter
you can do the xslt transform and you get the csv....

Hope this helps you.
--
Sincerely yours
Axel Kühn (visit my Dynamics AX blog at: http://blog.ak-home.net)
Post by Patrick Fiala
Hi,
I currently have the task to implement the export of data with Aif in
a 4.0-environment. Bascically no problem, however my process has to
create csv-files. The Aif creates xml-files in the firstplace, however
it is possible to modify the resultfile by a xslt-transformation in
the pipeline. So I've created a xslt-file which transforms the
xml-file resulting from the first step to a csv-file. When I add this
xslt-file as pipeline to my Aif process I get the errormessage "Data
at the root level is invalid. Line 1, position 1". My subsequent
investigations gave the result that the file finally created by the
Aif (after eventually executed steps in the pipeline) has to be a
valid xml-file. That would mean, that it isn't possible to create a
plain text-/csv-file with the Aif itself. For that an additional step
would be necessary which couldn't be executed within the
Aif-framework. Is this really the case or is there any possibility to
create a csv-file with the Aif and which I haven't found?
Regards
Patrick
.
Patrick Fiala
2010-06-18 12:37:54 UTC
Permalink
Hello Axel,

On Thu, 17 Jun 2010 11:06:09 -0700, Axel Kühn
Post by Axel Kühn
Hi Patrick,
[Solution: new transport adapter]
Hope this helps you.
Yes, this helped me. I've created a new file-adapter as copy of the
existing one and modified it as proposed by you. And it works
perfectly.
Thanks!

Regards
Patrick

Loading...