Dec 18th, 2007, 05:10 PM
Build a Web service Client with XFire and Spring 2.0
I want to use XFire and Spring Framework 2.0 to make a web service client. In the book "Spring in action", I have read that I have to use a bean with this configuration:
<?xml version="1.0" encoding="UTF-8"?>
<bean id="testWebService" class="org.codehaus.xfire.spring.remoting.XFireCli entFactoryBean">
<property name="wsdlDocumentUrl"> <value>http://localhost:8080/Citation/servivces/citation?WSDL</value>
Ok, fine, but I have only the wsdl file, so how can I generate the serviceInterface from the wsdl ?
This information is never wrote in the book or in the spring tutorial (http://static.springframework.org/sp...-jaxrpc-access)
It could be useful to add some new information about this subject.
Which tool should I use (wsdl2java from Axis or Xfire, or a tool from Spring ?)
Thanks for your help.
Dec 18th, 2007, 05:18 PM
I did not use xfire with Spring so far. But if it is just for generating the classes, you can probably use the Eclipse plugin:
Dec 19th, 2007, 03:18 AM
Thanks for the link, I will try the XFire Eclipse plugin, but I think there is maybe another solution inside the spring framework, perhaps a tool exists in the spring web service subproject.
Dec 19th, 2007, 04:23 AM
from my point of view Spring-WS rather an alternative to xFire because it actually provides the whole web service stack. So for me it would not be clear how to put the two together. But it would be interesting to see if someone can shad more light on that.
Dec 19th, 2007, 05:16 AM
I agree with you, Spring web service is an alternative to XFire and Axis, so this project should offer a tool to generate java classes from a wsdl file, but I didn't find it in the documentation.
Any information about this subject will be useful.
Dec 19th, 2007, 05:30 AM
I am not so sure about that. You see when you take xfire or axis you usually get a default object binding framework like jaxb or xmlbeans and the WS Stack generates the objects as well as the proxy for you.
This is quite convinient but can have drawbacks in large scale projects.
Anyhow in SprinWS you are free to use a lot of different ways to get the data into java. You can use old fashioned parsing, you can use object binding and object mapping.
In any case you make use of the projects like jibx, jax-ws, xfire and so on. So you need to use the tools that come with them.
But again I am quite new to spring-ws myself so I am not certain.
Dec 19th, 2007, 06:55 AM
I agree with you when you say that Spring WS is a web service stack.
I also agree with you when you say that jibx, jax-ws, xfire and so on are object data binding framework.
But I think that Spring Framework helps users to write a web service client, but nothing is specified in the Spring documentation about the generation by the user of the service interface with an object data binding framework like xfire.
So I think that Spring Framework (and not the Spring Web Service sub-project) should use a default object data binding framework (xfire for example) to generate the service interface and the complex java beans used by the interface.
what do you think about this idea ?