Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » problem generating CXF-Webservice Client
problem generating CXF-Webservice Client [message #525874] Thu, 08 April 2010 07:17 Go to next message
0vermind  is currently offline 0vermind Friend
Messages: 3
Registered: April 2010
Junior Member
Hi there,
I have successfully deployed my webservices using tomcat 5.5 and cxf 2.2.7.
Now i wanted to create a simple console application that consumes the ws. I created a "Java Project" in eclipse, and wanted CXF to generate the Client-Classes, using "New->Web Service Client".
But when I select my wsdl there an error shows up:

"The apache CXF 2.X Web service runtime in Tomcat v5.5 server does not support the client project wstest"
(btw: why do i have to select a server type within the client project?)

Thanks for your help, everyone.
Re: problem generating CXF-Webservice Client [message #526769 is a reply to message #525874] Mon, 12 April 2010 20:43 Go to previous messageGo to next message
Shane Clarke is currently offline Shane ClarkeFriend
Messages: 67
Registered: July 2009
Member
Hi 0vermind,

The latest version of JAX-WS Tools supports Dynamic Web Module v2.5 upwards.

Tomcat 5.5 only supports up to version 2.4 of the Dynamic Web Module.

To create a client using Apache CXF you first need to create a Dynamic Web Project.

Then open the Web Service Client wizard and enter the URI of the WSDL file.

Move the slider to the 'Develop Client' stage and check that Apache CXF is selected as the web service runtime in the Configuration section of the wizard.

Hitting Finish will generate the client into the selected project.

Have a look at the user documentation and cheat sheets that ship with the JAX-WS Tools. There's a cheat sheet there that covers all the steps required to generate a client.

Hope that helps.

Thanks,
Shane
Re: problem generating CXF-Webservice Client [message #526820 is a reply to message #525874] Tue, 13 April 2010 07:00 Go to previous messageGo to next message
0vermind  is currently offline 0vermind Friend
Messages: 3
Registered: April 2010
Junior Member
at first, thanks for your answer, shane.

i know how to generate a client in a dynamic web project. the problem is i want to generate a client in a 'normal' java console application. of course, i could generate the client classes in a dynamic web project and then copy the files to my standard java project, but is this really necessary? i simply couldn't figure out how to do this directly.

until recently i used netbeans and sun's jaxws implementation and the corresponding client wizard allowed me to create the stubs everywhere.
Re: problem generating CXF-Webservice Client [message #527071 is a reply to message #526820] Tue, 13 April 2010 21:50 Go to previous messageGo to next message
Shane Clarke is currently offline Shane ClarkeFriend
Messages: 67
Registered: July 2009
Member
There is no 'direct' wizard support for this.

But there is something you could try.

Create a Java Project. Let's call it JavaProject for example purposes.

Add the CXF classpath container to the build path. There's currently a bug with adding the classpath container to a Java Project through the Java Build Path properties page so you'll have to add the following to the JavaProject .classpath file by hand for now. (After having selected a CXF install in the Eclipse > Web Services > CXF 2.x Preferences page).

<classpathentry kind="con" path="org.eclipse.jst.ws.cxf.core.CXF_CLASSPATH_CONTAINER"/ >

Select File > New > Other > Web Services > Ant Files and in the resulting wizard:
* select the Apache CXF runtime as the web service runtime.
* select Client as the web service type.
* select the JavaProject for the 'Into Folder' field.

Hit Finish. This will generate two files into a JavaProject/ant folder.

Open the generated JavaProject/ant/cxf_client.properties file.

There are a couple of properties you'll need to edit here.

For the 'InitialSelection' property point to a wsdl file. The comment in the properties file says it has to be workspace relative but you can provide a remote wsdl file URI, same as you would with the Web Service Client wizard.

You also need to uncomment the 'JavaOutput' property to:

JavaOutput=/JavaProject/src

Select the other generated file JavaProject]ant/cxf_client.xml and select Run > External Tools > External Tools Configurations... from the top level menu.

Select 'Ant Build' and then the 'New launch configuration' button in the toolbar. The Buildfile property on the Main tab should be filled in.

Switch to the JRE tab in the configuration and select 'Run in the same JRE as the workspace'.

Hit Run and that will generate a client into the JavaProject.
Re: problem generating CXF-Webservice Client [message #527116 is a reply to message #527071] Wed, 14 April 2010 07:22 Go to previous messageGo to next message
0vermind  is currently offline 0vermind Friend
Messages: 3
Registered: April 2010
Junior Member
Shane Clarke wrote on Tue, 13 April 2010 17:50
There is no 'direct' wizard support for this.



maybe in a future release? why would anyone create clients only in web applications?
anyway, thanks for the tutorial. meanwhile i figured out an easier way and added cxf's 'wsdl2java' command to the external tools in eclipse.
Re: problem generating CXF-Webservice Client [message #1062777 is a reply to message #527116] Mon, 10 June 2013 17:14 Go to previous messageGo to next message
Steve Cook is currently offline Steve CookFriend
Messages: 1
Registered: June 2013
Junior Member
0vermind wrote on Wed, 14 April 2010 03:22

why would anyone create clients only in web applications?


Maybe like me they are trying to access a third party service (salesforce) instead of one I created. I used to do it with axis before, but now I have to use JAX-WS.

This because a bunch of geniuses at oracle though hey, lets take a common distributed library and change it without giving it a new package or supporting the existing functionality, so that no one can use their own stuff that relies on it.
Re: problem generating CXF-Webservice Client [message #1067730 is a reply to message #527071] Wed, 10 July 2013 10:23 Go to previous messageGo to next message
Marco Marinangeli is currently offline Marco MarinangeliFriend
Messages: 2
Registered: July 2013
Junior Member
Shane Clarke wrote on Tue, 13 April 2010 17:50
There is no 'direct' wizard support for this.

But there is something you could try.

Create a Java Project. Let's call it JavaProject for example purposes.

Add the CXF classpath container to the build path. There's currently a bug with adding the classpath container to a Java Project through the Java Build Path properties page so you'll have to add the following to the JavaProject .classpath file by hand for now. (After having selected a CXF install in the Eclipse > Web Services > CXF 2.x Preferences page).

<classpathentry kind="con" path="org.eclipse.jst.ws.cxf.core.CXF_CLASSPATH_CONTAINER"/ >

Select File > New > Other > Web Services > Ant Files and in the resulting wizard:
* select the Apache CXF runtime as the web service runtime.
* select Client as the web service type.
* select the JavaProject for the 'Into Folder' field.

Hit Finish. This will generate two files into a JavaProject/ant folder.

Open the generated JavaProject/ant/cxf_client.properties file.

There are a couple of properties you'll need to edit here.

For the 'InitialSelection' property point to a wsdl file. The comment in the properties file says it has to be workspace relative but you can provide a remote wsdl file URI, same as you would with the Web Service Client wizard.

You also need to uncomment the 'JavaOutput' property to:

JavaOutput=/JavaProject/src

Select the other generated file JavaProject]ant/cxf_client.xml and select Run > External Tools > External Tools Configurations... from the top level menu.

Select 'Ant Build' and then the 'New launch configuration' button in the toolbar. The Buildfile property on the Main tab should be filled in.

Switch to the JRE tab in the configuration and select 'Run in the same JRE as the workspace'.

Hit Run and that will generate a client into the JavaProject.


Thank you so much!!!! It's been very useful!
Re: problem generating CXF-Webservice Client [message #1067732 is a reply to message #527071] Wed, 10 July 2013 10:33 Go to previous messageGo to next message
Marco Marinangeli is currently offline Marco MarinangeliFriend
Messages: 2
Registered: July 2013
Junior Member
Shane Clarke wrote on Tue, 13 April 2010 17:50
There is no 'direct' wizard support for this.

But there is something you could try.

Create a Java Project. Let's call it JavaProject for example purposes.

Add the CXF classpath container to the build path. There's currently a bug with adding the classpath container to a Java Project through the Java Build Path properties page so you'll have to add the following to the JavaProject .classpath file by hand for now. (After having selected a CXF install in the Eclipse > Web Services > CXF 2.x Preferences page).

<classpathentry kind="con" path="org.eclipse.jst.ws.cxf.core.CXF_CLASSPATH_CONTAINER"/ >

Select File > New > Other > Web Services > Ant Files and in the resulting wizard:
* select the Apache CXF runtime as the web service runtime.
* select Client as the web service type.
* select the JavaProject for the 'Into Folder' field.

Hit Finish. This will generate two files into a JavaProject/ant folder.

Open the generated JavaProject/ant/cxf_client.properties file.

There are a couple of properties you'll need to edit here.

For the 'InitialSelection' property point to a wsdl file. The comment in the properties file says it has to be workspace relative but you can provide a remote wsdl file URI, same as you would with the Web Service Client wizard.

You also need to uncomment the 'JavaOutput' property to:

JavaOutput=/JavaProject/src

Select the other generated file JavaProject]ant/cxf_client.xml and select Run > External Tools > External Tools Configurations... from the top level menu.

Select 'Ant Build' and then the 'New launch configuration' button in the toolbar. The Buildfile property on the Main tab should be filled in.

Switch to the JRE tab in the configuration and select 'Run in the same JRE as the workspace'.

Hit Run and that will generate a client into the JavaProject.


Thank you very much.. it's beeen very useful...
If you use Tomcat 7 you should also change one statement in the JavaProject/ant/cxf_client.properties file:

Client.ServerId=org.eclipse.jst.server.tomcat.60
becomes
Client.ServerId=org.eclipse.jst.server.tomcat.70


Re: problem generating CXF-Webservice Client [message #1772841 is a reply to message #1067732] Sat, 16 September 2017 21:53 Go to previous message
Ankit Kumar Singh is currently offline Ankit Kumar SinghFriend
Messages: 1
Registered: September 2017
Junior Member
Hi,

I tried the approach mentioned by you and the ANT build was a success.
However i do not see any files any generated in my 'src' folder.

Please let me know what other details i can provide you to have a better understanding of the problem.

Regards
Ankit
Previous Topic:IWAB0489E Error when deploying Web service to Axis runtime
Next Topic:Starting Tomcat with Java 9
Goto Forum:
  


Current Time: Fri Apr 26 22:09:29 GMT 2024

Powered by FUDForum. Page generated in 0.03587 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top