I need to send a XML file using POST to a web service. I have a client application that creates a XML file which stores all the information required to send to the web application, but I am not sure how to go about sending it.
My XML looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Comment>
<Poll_ID>2</Poll_ID>
<Name>wpoon</Name>
<Text>asdasdas</Text>
<Timestamp>2012-10-14T10:30:25</Timestamp>
</Comment>
And the RESTful service I will be sending it to has the URL:
http://localhost:8080/TESTINGrestful/rest/polls/comment
Could anyone advise me how to do this, any help would be appreciated.
There’s a good example here from Apache HttpClient: