Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how can I create the client that consume a web service

 
samir mohamed
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java EE 5 tutorial contains a chapter on JAXB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic