Read remote xml file

Asked

Viewed 455 times

2

2 answers

2

Clayton, with the url that generates the xml, what you have to do is use a library that requests Rest to download the xml for your application and after that you process the xml.

  • Do you know of any library that does this? Ildyone

  • 2

    You will have to search, because this will also depend on which version of the language you are using as well as the operating system. Don’t forget to vote for the answer.

2


Clayton,

PHP contains a way to read XML files natively, without another library. There is documentation here, in Portuguese itself, from the XMLReader. It doesn’t matter if the XML file comes from a website or if it comes from a physical file.

  • good morning so I am using xmlreader as you indicated me, plus I am having the following problem if the file is in the same folder it works, plus when the file is to pick up through the error URL. $file = 'cross-docking.xml'; $xml = new XMLReader();
$xml->open($file);

code$file = 'http://webmax.hayamax.com.br/crossdock/servlet/CrossDockingServlet.class.php?action=crossDockingPrice&customerId=10363&compress=0&canal=C1'; $xml = new Xmlreader(); $xml->open($file);

  • Edit your question with the error q received please

  • error 500, my hosting does not show the line that is the problem, in the log file gave 2015-08-12 15:53:59 W3SVC6 PLESKCW0022 186.202.119.39 GET /hayamax/teste.php - 80 - 200.193.178.177 HTTP/1.1 Mozilla/5.0+(Windows+NT+10.0;+WOW64;+rv:39.0)+Gecko/20100101+Firefox/39.0 - - www.shoplivre.com.br 500 0 0 1579 333 67485

  • I put this URL in my browser (http://webmax.hayamax.com.br/crossdock/servlet/CrossDockingServlet.class.php?ac tion=crossDockingPrice&customerId=10363&compress=0&canal=C1) but it does not give an XML file ... would you need anything else?

  • Besides, if you get a 500, you usually say something’s wrong with server, that is, a problem with the site itself.

  • plus I told you if I switch to $file = 'cross-docking.xml'; it works the error only happens when I have the url configured. $file = 'http://webmax.hayamax.com.br/crossdock/servlet/CrossDockingServlet.class.php?ac tion=crossDockingPrice&customerId=10363&compress=0&canal=C1';

  • This URL only works on my domain, http://www.shoplivre.com.br/hayamax/haymax.php (at this link for you to try to generate xml) on another domain will not work because the ip of my domain is released on my provider’s server.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.