We have developed a RESTful web service which expects an XML string to arrive as "parameter". For QA to test the web service, I am looking for a simple way to POST an XML string to a URL, then display the XML response from the server.
Is there an easy way to POST an XML string to a URL?
To post XML data to the server, you need to make an HTTP POST request, include the XML in the body of the request message, and set the correct MIME type for the XML. The correct MIME type for XML is application/xml.
The new Postman app also supports collections of tests that can be run as a suite. However, I needed to test the web services of an application with REST endpoints and XML request payloads and responses. The test orchestration needed dynamic payloads, dynamic parameters, and test routing.
Get the Firefox Poster add-on.
A developer tool for interacting with web services and other web resources that lets you make HTTP requests, set the entity body, and content type. This allows you to interact with web services and inspect the results.
I used wget for that, there are Windows and Linux versions. Not GUI either but no need of graphical interface for such simple task.
For example:
wget "http://url_of_my_web_service?param1=123¶m2=abc" --post-file="xmlTestFile.xml" --header="Content-Type:text/xml"
Where the xmlTestFile.xml it's an xml file in the same directory you run the wget command.
If you want to send a xml string instead of a xml file, use --post-data="string"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With