This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes how can I create the client that consume a web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "how can I create the client that consume a web service" Watch "how can I create the client that consume a web service" New topic
Author

how can I create the client that consume a web service

samir mohamed
Greenhorn

Joined: Jul 04, 2007
Posts: 14
Hi

I want to learn java web services, I used Apache axis as follows:

I put a file called greeter.jws in C:\Tomcat 5.5\webapps\axis
-greeter.jws contains the following code:

public class greeter {
public String greetme(String s){
return "How are you?������.."+s;
}
}

When I start the browser with the URL : 'http://localhost:8080/axis/greeter.jws'

I have got a link to the WSDL file

How can I use this service from a JSP or servlet client (java client)?

Best Regards
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
(the jws suggests to me that you are using Axis 1.x)
Have a look at Creating Web Services with Apache Axis. In the later part it explains how to generate a client stub and then uses it in a command-line program. You should be able to use that stub directly in a servlet.

J2EE Tutorial; Web Services Clients; Application Client shows how to acquire the client stub though JNDI, provided that you have set up the <service-ref> deployment descriptor in the web.xml (Tomcat 5.5 probably doesn't support the <service-ref> descriptor).
[ July 20, 2007: Message edited by: Peer Reynders ]
samir mohamed
Greenhorn

Joined: Jul 04, 2007
Posts: 14
Thanks Peer

The site you showed was very useful,
I want to learn about JAXB, do you know any site that explains JAXB through examples (step by step).

Best Regards
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41592
    
  55
The Java EE 5 tutorial contains a chapter on JAXB.


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how can I create the client that consume a web service