aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 2906
(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 ]

"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
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: 39544
    
  27
The Java EE 5 tutorial contains a chapter on JAXB.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can I create the client that consume a web service
 
Similar Threads
How to change the name of the binding element in wsdl file ?
General Doubts in WebServices after Fibonacci Example
How to change the name of the binding element in wsdl file ?
Help neded for developing the web service
Java -> WSDL and WSDL -> Java