Answer the question
In order to leave comments, you need to log in
What is the best way to store xml queries in php?
Hello!
A PHP application is being developed that interacts with a web service through XML requests over SOAP. There are quite a few requests. Some are static, some need to be generated on the fly, substituting some data into the request.
The question is how best to organize the storage of XML queries? I myself see two options so far:
1. Store requests in files of the form xml/RequestName.xml. It is necessary to send a request - we read the contents of the file into the variable. If you need to substitute some data, then we use the simplest template engine, such as {MYVAR} and replay {MYVAR} to $myVar.
2. Make a function for each request, such as function xmlRequestName($myVar), in which the XML request template will be written inline and which will generate a request with the necessary data at the output.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question