I am writing a proxy service to cache requests that my mobile application makes for a web service. (like a man in the middle)
The task of the proxy site that I created is to transfer the request that it receives from the application to a third-party web service and save the response from the third-party web service as an XML file and for all subsequent calls for the same request read from XML file and provide the response (basically caching the response - using Php, curl and simplexml_load_file).
Now my question . What is the recommended way to read an XML file and return a string.
option 1: $ contents = file_get_contents ($ filename); echo $ contents;
option 2: $ XML = simplexml_load_file ($ filename) echo $ xml-> asXML ();
xml php web-services simplexml
gforg
source share