REPOST : Let’s make a SOAP request from command line (curl)?

Good article, repost from here

Hellow there folks! These days most of the web services are exposed as REST or SOAP. There could be a chance where you need to make a request from your command line rather than installing a tool such SOAPUI. Tools are really helpful but there are times where you can’t use tools. I’ll be using curl to make the request. if you don’t know about curl it can transfer data using various protocols. If you don’t have curl installed use the below command.

 

SOAP Request Flow

SOAP request

Image Courtesy : java-forums.org

Step 1

Let’s create a SOAP envelope as below which is the SOAP request to be sent via curl. Create a file with the below content named “request.xml”. The SOAP envelope and the SOAP request parameters depend on your web service.

 

Step 2

Let’s make a request using the curl command.

 

Below mentioned should be replaced according to your web service.

  1. ACTION_YOU_WANT_TO_CALL
  2. FILE_NAME
  3. URL_OF_THE_SOAP_WEB_SERVICE_ENDPOINT

See the example below to get an idea.

See the sample O/P below. You should get a similar O/P according to your web service.

Example O/P

 

Hope you got an idea how to make a request SOAP request using command line. If you have any questions let me know in the comments below. Your feedback is highly appreciated(happy-face).

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s