You should try to use a more current version of CXF. It will be difficult to get support for this version.

You can use a java first aproach with CXF. Take a look at the java_first examples in the distro. You have to add apropriate JAXB and JAX WS annotations of course. We used a similar aproach at my former employer when we still used XFire. When switching to CXF we had some problems though. If you use the same code for CXF and Xfire the data on the wire will be different. Often these are subtle changes like if the first letter of an xml element is lower or upper case.

The problem is quite general though. There is no precise standard how to generate XML out of Java. So you might always have this problem. This was the reason for use to switch to a contract first scheme. Java first still has its place but I would only use it for internal communications inside one program where you control server and client and the have a synched release cycle.

As writing WSDLs is hard we used java code to generate the WSDL but then used the WSDL as the contract. This worked quite well and might also be useful for you. See:
http://www.liquid-reality.de/display/liquid/2008/08/20/Defining+Contract+first+webservices+by+generating+wsdl+from+java

Christian


Am 11.05.2012 10:34, schrieb Stefan Schilling:
Hello,

we're currently switching from XFire to Apache CXF 2.2.9 (I know, I know ... 
it's old...).
Using XFire, the various service providers offered the clients a "client.jar", 
containing all interfaces, transfer objects and enumerations (wsdl was not provided nor 
needed by the client).

Using CXF, of course we can generate our own stubs, but it would be much more 
comfortable to just keep using those plain client.jar - given the 
infrastructure available here.

XFire basically only needs the following settings:

<bean id="BeanRefName" 
class="org.codehaus.xfire.spring.remoting.XFireClientFactoryBean">
   <property name="serviceClass" value="THE INTERFACE" />
   <property name="url" value="THE URL" />
   <property name="wsdlDocumentUrl" value="THE WSDL URL" />
   <property name="lookupServiceOnStartup" value="false" />
   <property name="properties">
     <map>
       <entry key="objectServiceFactory.portType">
         <bean class="javax.xml.namespace.QName">
           <constructor-arg value="THE NAMESPACE" />
           <constructor-arg value="THE PORT TYPE DEFINITION" />
         </bean>
       </entry>
     </map>
   </property>
</bean>
        
... no stub generation from wsdl was required. This is extremely helpful, when 
enumerations are used, but their value transfer is done through Strings - 
therefore the enumeration's contents do not show up in the wsdl (bad practice, 
but reality).

Now: is there any way to continue using the client.jar (therefore not 
generating stubs from wsdl) with Apache CXF.

Thanks a lot.

Regards,

Stefan


--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com

Reply via email to