Import XML file

0
What is the right way to import an XML file in a mx 5.2 project? I've tried to import it with a "add consumed web service" but this gives an error on the file : System.InvalidOperationException: The document at the url file:///C:/Users/Niels/Desktop/test.xml was not recognized as a known document type. The error message from each known type may help you fix the problem: - Report from 'XML Schema' is 'The root element of a W3C XML Schema should be <schema> and its namespace should be 'http://www.w3.org/2001/XMLSchema'.'. - Report from 'DISCO Document' is 'Discovery document at the URL file:///C:/Users/Niels/Desktop/test.xml could not be found.'. - The document format is not recognized. - Report from 'WSDL Document' is 'There is an error in XML document (1, 2).'. - <catalog xmlns=""> was not expected. at System.Web.Services.Discovery.DiscoveryClientProtocol.DiscoverAny(String url) at Mendix.Modeler.Integration.WebServices.Call.WsdlDescription.ResolveImports(Uri url) in c:\jenkins\workspace\AppStudio-Integration-Modeler\src\modeler\Mendix.Modeler.Integration\WebServices\Call\WsdlDescription.cs:line 252
asked
3 answers
0

What is the purpose of importing the XML file? If you want to map an XML file to your domain model, this is something you have to do at runtime. To do this you have to create an 'import XML' activity in your microflow and have the XML ready as a FileDocument. You seem to be trying to add the XML while modeling and I do not understand what you're trying to achieve..

Updated according to answer: You have to get your file document into the system at runtime, you can't import a file document while modeling. You do have to create some functionality first to be able to get the file document into your system, probably by adding an upload file page. Then you can do the XML to domain mapping.

answered
0

well, actualy I just want to do this : https://world.mendix.com/display/howto40/Import+XML+documents

after the second step it says

"Make sure that the XML document and (if necessary) the object that has to be passed to the XML-to-domain mapping as parameter are either created in the microflow or passed to it."

So i want to add the xml document, but I can't find where I can do this. I can't find a add filedocument option.

thx

answered
0

well, actualy I just want to do this : https://world.mendix.com/display/howto40/Import+XML+documents

after the second step it says

"Make sure that the XML document and (if necessary) the object that has to be passed to the XML-to-domain mapping as parameter are either created in the microflow or passed to it."

So i want to add the xml document, but I can't find where I can do this. I can't find a add filedocument option.

thx

answered