SOA / Web Services / Java

A Technology Blog

Using CURL to invoke web service

Posted by Vivek on February 10, 2013

CURL  is an interesting tool that provides command line option to send requests over HTTP/ HTTPS. It is a handy tool when there is a requirement to send requests in bulk or through a scheduled job using scripts.

To invoke a service using CURL, you just need to create web service request, place it in a directory and run curl command as a client. For example, to send binary data using CURL:

curl –data-binary @MySOAPRequest.xml http://<host>:<port>/MyService

There are various command line options. A comprehensive list and exit codes can be found here: http://curl.haxx.se/docs/manpage.html

You can download CURL binaries from – http://curl.haxx.se/download.html

After downloading, make sure that you add CURL to the PATH environment variable.

If there is a need to execute some security functiona, download OpenSSL and place libssl32.dll file into the CURL directory.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: