This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Web Services and the fly likes webservice calling from url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Web Services
Bookmark "webservice calling from url" Watch "webservice calling from url" New topic

webservice calling from url

Miku Ranjan
Ranch Hand

Joined: Oct 11, 2011
Posts: 98
I want to call web service direcltly using a url is it possible?
If yes how.

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13001
Of course it is possible, how depends on the service so you will need documentation of the service.

1. if a SOAP service you will need to create a SOAP message as a request to the URL.
2. if a REST service you will need a URL that is correctly formatted to address the service HTTP method desired

H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
I'll give you what I have - no more no less

Assume, you use window

1. Go to

Download maven

2. Go to
Unzip it to C:\ drive for example.

Go to
read README.txt

Basic: resteasy-jaxrs-2.2.3.GA is an implementation of JAX-RS - Restful web service.

ex03_1 has a client using URL. So here you have an example of using URL to talk to Restful web service on the server side.

Run the example;

C:\\resteasy-jaxrs-2.2.3.GA\examples\oreilly-workbook\ex03_1>mvn install
you will the output on the command line

For more: Use your friend GOOGLE for key words like:

Restful web service with URL
Soapful web service with URL
Soapful JAX-WS web service
Restful JAX-RS web service
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
For Restful web service, below are 2 different CLIENT ways:

1. Use Jersey JAX-RS client API
2. Use Apache HttpClient 4.x

If you scan the code, you will see that I'm NOT the President.

Miku Ranjan
Ranch Hand

Joined: Oct 11, 2011
Posts: 98
Hi Paul,
Thanks for the reference and the example code.
It is really helpful.
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
For Server side, I re-write my Rest President to Soap President

For Client side, I use Apache-HttpClient/4.1.2 to send a Soap Request to the Server. The Soap Request is hard-coded.

Normally, for fun, we do this way because we should use JAX-WS or SAAJ by constraint.

I agree. Here's the link:
subject: webservice calling from url
jQuery in Action, 3rd edition