views:

362

answers:

5

Can you tell the BEST way how to test & use Web Services in Eclipse ?

I had little experience with web services, that is, I used an Apache Axis plugin that generated the client stub.

I do not need to write my own web services right now, only use existing ones. I have Eclipse JEE, I can download any plugin. What would you suggest?

+1  A: 

Your JEE eclipse already include WTP (Web Tool Platform), so you shouldn't download another plugin.

All you need now is to follow one of those tutorials


WTP:

The Eclipse Web Tools Platform (WTP) project extends the Eclipse platform with tools for developing Web and Java EE applications

It includes a web services section with 2 components:

  • The JST Web services component contains tools for developing and interacting with Java Web services.
  • The WST Web services component contains tools for Web services development which is not Java specific.
VonC
EugeneP
Seconded. Using WTP you can create a web service client by selecting File > New > Other > Web Services > Web Service Client and defining the address for the WSDL... It should get you started fairly quick.
Aleksi
WTP is included in the Eclipse JEE edition.
Thorbjørn Ravn Andersen
@Thorbjørn:true, I have edited my answer accordingly
VonC
A: 

Add the WSDL file to the root of an Eclipse project, right-click on it, select "Web Services" and "Generate client", set the cursor to "Assemble" and Eclipse will generate the Java code that will allow you to communicate with the Web Service.

Nicolas Raoul
A: 

I believe that the easiest way to test web services with Eclipse is the Axis2 plug-in, which is bundled in the JEE edition. Here is an article about it. It focuses on services and not clients, but it is even easier if you already have a running service and want to create a client.

kgiannakakis
oh, yeah, I tried it already. Although it is difficult to install in Galileo, it works well. Though, I may suppose, there are better solutions than that plugin, aren't there?
EugeneP
If you download the Eclipse for Java EE developers, the plug-in should already be there. There are better frameworks than Axis 2 (most notably http://cxf.apache.org/), but I think that Axis2 is easier to use with Eclipse.
kgiannakakis
+1  A: 

Take a look at Eclipse Swordfish project.

From it's home page:

The goal of the Swordfish project is to provide an extensible SOA framework based on the proven Eclipse Equinox runtime technology. The framework is designed to be complemented by additional open source components such as a service registry, a messaging system, a process engine etc. to form a comprehensive open source SOA runtime environment based on both established and emerging open standards.

Roland Tepp
it's still in incubation, so perhaps not entirely good idea to use it in production. But perfectly fine for learning.
Bozho
Eclipse incubation projects are quite often surprisingly stable long before they get promoted out of incubation.
Roland Tepp
+2  A: 

To test web services, the best tool is IMHO soapUI which is available as an eclipse plugin and is superior by far to any other tool I've used.

To use web services, it's worth noting that Eclipse has now a JAX-WS Tools Project (in the Web Tools Incubator) which is using the Apache CXF implementation (please, let Axis 2 die).

To install this project, point your Eclipse update site manager to The Eclipse Web Tools Platform (WTP) Project update site - http://download.eclipse.org/webtools/updates. When you access the update site, you should see the CXF Web Services (Incubator) feature available in the listing:

alt text

Once installed and configured (Window > Preferences... > Web Services > CXF 2.x Preferences), you will be able to use the CXF runtime to test web services (and / or to create a CXF Web Services Project, see image below even if this is not your first goal).

alt text

You will find some video clips showing you how to create and deploy Bottom-Up and Top-Down Web services using JAX-WS Tools here.

Pascal Thivent