IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

C# generated code input string instead of file Options · View
ph9
Posted: Monday, October 1, 2018 9:00:45 PM
Rank: Newbie

Joined: 9/18/2018
Posts: 8
Is it possible to have Altova generate C# code that will take a string of the XML data instead of having it read from a file? Is there a setting that needs to be changed or would we need to modify the generated C# code to do this?
rasgeado
Posted: Wednesday, October 3, 2018 2:39:09 PM
Rank: Member

Joined: 3/25/2015
Posts: 19
After generating C# code, look for the Main() method in the generated code. It contains comments that list all data types that you can use as arguments to the run() method, including string. So yes, you can pass a string instead of XML this way. You might also want to check the documentation.

If you don't want to tweak the generated code, you could design your mapping so that it parses a string supplied as parameter to XML; however, in this case you would need to change the mapping execution language to Built-In instead of C# and run it with MapForce Server.
ph9
Posted: Wednesday, October 3, 2018 6:29:22 PM
Rank: Newbie

Joined: 9/18/2018
Posts: 8
This answers my question, thank you for your help rasgeado.
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.