File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes How to call web services from java class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to call web services from java class" Watch "How to call web services from java class" New topic

How to call web services from java class

Nilu Deshmukh

Joined: Aug 03, 2009
Posts: 22
I have created one webservice Hello.wsdl using eclipse.
It simply accepts String name and Prints Hello <name>
I had tested that using SOAP 3.0 UI. Application.
Now I created Client for Hello.wsdl.

It created in java.src in com.tutorial package.
Now I created one HelloTest class to test that web service.

the webservice code of HelloTest is as follows

But I am getting following Exception...

Exception Occured ...(404)Not Found

I have following queries...

1)What's wrong with this code...
or how can i call web service from java or jsp code..

and 2)when i created the webservice the "wsdlsoap:address location" is of my local machine
if i want to run it on different machine then can I replace the loaclhost address with
new one i.e Client machine IP.

Please Reply.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
Have you seen these excellent tutorials?
Best wishes!
I agree. Here's the link:
subject: How to call web services from java class
It's not a secret anymore!