You need to sign in to do that
Don't have an account?
Thewalking face
read and parse an xml file using web service
Hello,
I'm a beginner to apex, I want to create a web service to attach and parse an xml file. My file is hosted in an FTP server. The goal is to retrieve the XML file to insert the data into a salesforce object.
I try with the code below:
webservice static String parse(String url) {
DOM.Document doc = new DOM.Document();
try {
doc.load(url);
DOM.XMLNode root = doc.getRootElement();
String message = 'File find';
return message;
}
// catch error
catch (System.XMLException e) {
return e.getMessage();
}
}
But it doesn't work with the url (C:\files\file.xml)
Can you help me please ?
Thank's in advance
I'm a beginner to apex, I want to create a web service to attach and parse an xml file. My file is hosted in an FTP server. The goal is to retrieve the XML file to insert the data into a salesforce object.
I try with the code below:
webservice static String parse(String url) {
DOM.Document doc = new DOM.Document();
try {
doc.load(url);
DOM.XMLNode root = doc.getRootElement();
String message = 'File find';
return message;
}
// catch error
catch (System.XMLException e) {
return e.getMessage();
}
}
But it doesn't work with the url (C:\files\file.xml)
Can you help me please ?
Thank's in advance
Refer this link: https://salesforce.stackexchange.com/questions/60770/xml-parsing-using-apex-in-salesforce