22

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?

1

11 Answers 11

22

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.

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

2 Comments

There's Chrome Poster too. It doesn't support POST variables - not sure if the FF one does.
Firefox Poster is not compatible with Firefox 57 (Quantum).
9

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&param2=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"

2 Comments

You probably want Content-Type: application/x-www-form-urlencoded if, per the OP, you're POSTing a parameter.
Use --output-document=FILE and perhaps --server-response
5

soapUI has support for RESTful services, as well as for SOAP-based services.

Comments

5

Chrome's DHC by Restlet is pretty good. For some reason the "form" and "transformation" options are disabled for me though.

Comments

2

SOAPUI is very nice tool for testing web services (with gui)

Comments

1

not a gui, but curl is a popular tool.

1 Comment

1

Obviously an old question, but google brought me here so I wanted to add another resource:

http://www.hurl.it/

Tell it where to send the info, how you want it posted and the data you want to send and it will print out the response from the website.

Comments

1

Just an addition to the Firefox add-on, since Poster seems out of date, you may try HttpRequester.

Comments

0

If you're on OSX, HTTP Client App is incredibly useful for debugging HTTP services..headers, XML, whatever you like.

http://ditchnet.org/httpclient/

Comments

0

If you're using Eclipse, it has a built in Web Services client. I had to switch to the Java EE perspective and then find the right button on the main menu bar to launch it.

Once it's up, create a new WSDL page, enter the WSDL url, and then from there you can browse the web service and make requests. If you click the source button in the top right you can manually enter the XML you want to send.

http://www.eclipse.org/webtools/jst/components/ws/M4/tutorials/WebServiceExplorer.html

Comments

0

HttpMaster can be used for this testing scenario.

It supports XML posting (with possible parameters, if you need multiple requests in one batch) and viewers (raw and friendly) to view response. If you need only simple post and get, then it's quite possible that such full-fledged tools are simply too much; maybe some browser plugin could be sufficient for simple requests.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.