1

I'm new to Zend Framework 2 and I have to use a XML POST request to call a webservice.

I've gone through ZF2 documentation and found out that I can use the following.

Zend\DOM\Query  (to parse the xml respose)
Zend\Http\Client 
Zend\XmlRpc\Client

My xml post request is a lengthy one. I can start this with Zend\Http\Client and what I can't understand is where to store the xml request? Is is convenient if I keep the xml data in the code itself or do I have to store the xml requst on another document and load the document when calling the webservice? Also I need to change the values of the parameters of the xml post request per webservice call.

What do I need to do? I think I've not grabbed the basics of XML POST requests. But I could not find a proper answer in the internet to resolve my issue.

1 Answer 1

1

If you're posting a large amount of XML data that is mostly the same each time, it might make sense to store it on the file system, but you could do it either way - do whatever makes the most sense for your app.

Although you can use DOM query to parse XML, you might want to look at simplexml, which is PHP's native XML parsing lib.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.