XML-file import from website

Hey I don’t know were to put this question, so please guide me if I’m wrong. My problem is: I have no problem in import xml-data from an xml-document from my harddisk (http://www.henrikhartig.dk/XML_Customer.xml) But how can I transfer xml from a website? My codeunit looks like this: IF NOT EXISTS(‘C:\XML_Customer.xml’) THEN ERROR(‘xml-dokument dosn’t exist.’); TestFile.OPEN(‘C:\XML_Customer.xml’); TestFile.CREATEINSTREAM(TestStream); XMLPORT.IMPORT(60000,TestStream); TestFile.CLOSE; MESSAGE(‘SUCCESS’); /henrik

Hi Henrik, I assume you have Navision 4 due to the xmlport variable. We made something similar in Navision 3.60 with an xml Automation object “XMLDoc” (Type: ‘Microsoft XML, version 2.0’.DOMDocument). CREATE(XMLDoc); XMLDoc.async:= FALSE; ok:= XMLDoc.load(‘http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml’); I’m not familiar with the xmlport object of Navision 4, maybe you can combine it with the automation variable, or you can load the data directly from the server with it? [8)] Best Regards feri

Thank you. I will try your suggestion at a later time. I’ll be back. /Henrik

Hi Fery I have tried your suggestion, with some luck You have to excuse me, but I’m novice in both XML and Navision 4 XML-Port. So please tell me in details what to do [:I]: CREATE(XMLDoc); XMLDoc.async:= FALSE; ok:= XMLDoc.load(‘http://www.henrikhartig.dk/XML_Customer.xml’); IF NOT ok THEN ERROR(‘xml-document does not exist’); MESSAGE(‘SUCCESS’); It seems that ok return true if an xml-document exist. So very fine. But where do i go from here? How can I get the xml-document so I can import the xml-data in Navision? Hopefully you can help me [:)] /henrik

Hi Henrik, as we don’t use Navision 4, I’m not that familiar how to handle that xmlports… sorry [:(] I found a thread about xmldom http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=14659&SearchTerms=xmlport, maybe that can help you? Best Regards feri

Hey Ferri Yes I have Navision 4. I’m glad for your time. I might be back with a solution. Best regards Henrik