On 07/01/2011 1:09 PM, Glen Mazza wrote:
The IDE should just be for coding, not building your project, I would rely on Maven (or if you have to, Ant) for that: http://www.jroller.com/gmazza/entry/web_service_tutorial, after a little setup headache, things will be much faster and more automated for you that way.

Eclipse/STS is a great (free) tool that addresses the development process through to build very well.
It also does the deploy step as well.
It integrates Eclipse with all the plug-ins that you need to develop any Java app.

It includes a nice integration with Maven and makes your life very simple.
Saves a lot of the grief involved in getting a full Eclipse IDE installed. - just download and install and your Eclipse has all the plug-ins ready to go.

You problem appears to be on the client side but it is hard to tell.

Ron

 Glen


On 07.01.2011 02:11, Michael wrote:
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!




Reply via email to