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?

Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
Priyank
  • 14,231
  • 18
  • 78
  • 107
  • Possible duplicate: [How do I manually fire HTTP POST requests with Firefox or Chrome?](https://stackoverflow.com/q/4797534/3357935) – Stevoisiak Nov 14 '17 at 20:26

11 Answers11

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.

Tomalak
  • 332,285
  • 67
  • 532
  • 628
ohnoes
  • 5,542
  • 6
  • 34
  • 32
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"

David Aleu
  • 3,922
  • 3
  • 27
  • 48
5

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

John Saunders
  • 160,644
  • 26
  • 247
  • 397
5

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

josliber
  • 43,891
  • 12
  • 98
  • 133
Steve Bennett
  • 114,604
  • 39
  • 168
  • 219
2

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

jle
  • 9,316
  • 5
  • 48
  • 67
1

not a gui, but curl is a popular tool.

Pierre
  • 34,472
  • 31
  • 113
  • 192
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.

helgatheviking
  • 25,596
  • 11
  • 95
  • 152
1

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

Giraldi
  • 16,451
  • 6
  • 33
  • 52
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/

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.

Joxi
  • 586
  • 1
  • 5
  • 11
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

Jason Wheeler
  • 872
  • 1
  • 9
  • 23