how can I create the client that consume a web service
samir mohamed
Greenhorn
Joined: Jul 04, 2007
Posts: 14
posted
0
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: 2906
posted
0
(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 ]