I'm trying to use Eclipse Helios (3.6), CXF 2.3.0, JDK 1.6.0_22 and Tomcat 6.0
for web service development and deployment. Can anyone tell me if this is
feasible? I'm asking this question because I'm having an awful time trying to
get just a very simple HelloWorld code first web service to run!!! Let me
explain my method. This is going to be a bit long but please stay with it.
I have Eclipse configured to use JDK 1.6.0_22 and the CXF 2.3.0 runtime.
First I create a Dynamic Web Project in Eclipse.
To this project I add the following class:
package org.self.ws;
public class HelloWorld
{
public String SayHello( )
{
return "Hello";
}
}
Next I build the Dynamic Web Project.
Then I select the HelloWorld.java file and choose Create web service from the
Eclipse menus.
I use all the defaults on the web service wizard, a JAX subpackage is added to
my package and a WSDL is created in a wsdl folder under the WebContent folder.
I modify the soap:address in the WSDL to point at the folder structure where I
will deploy my .war file in Tomcat.
Then from the Eclipse menus I export my project to a .war file and have Eclipse
write it directly into the Tomcat webapps folder. The folder structure created
when the .war file is deployed at Tomcat startup is:
.\webapps
HelloWorld
META-INF
WEB-INF
classes
lib
wsdl
Now I generate client code from the WSDL I created above.
I do this by creating a new Web Service client in another Dynamic Web Project,
again by using the Eclipse menus.
Then I copy the generated code to a simple Eclipse Java project, because I just
want to display the result of the web method call on the console.
I build the client.
I export it to an executable .jar.
When I run the executable .jar I get the following error:
Exception in thread "main" javax.xml.ws.WebServiceException:
No Content-type in the header!
Using this procedure I do not see any CXF import statements in any of the code
generated even though I'm using the CXF runtime to generate this code. So to
respond to a post by Dan Kulp, yes everything generated appears to be just
using the JAX-WS stack. But unless I'm wrong this should still work, i.e. my
client should be able to call the service.
Is there something wrong in this approach that I'm missing? Is that why no one
appears to be able to answer how this should work using Eclipse? Is Eclipse
not build and deploying my .war file correctly and that's why, at least it
appears, that even when Eclipse is used Ant or Maven are still used for
building and deploying?
And lastly, I know all the open source contributors devote a great deal of time
to these projects, but something this easy should not be this difficult.
Please try to see this from the point of view of someone who does not wish to
contribute, but only use the tools. As a software engineer with almost thirty
years of experience it does not give me a warm and cozy feeling about open
source, not just Apache but Eclipse also ( I don't want any to take this
personal ), it's just a little venting!