Hi,
Thanks for your help.
I will try this soon.
As a work-around, I've created a WebServiceController class extending
XFireExporter. When the request.getQueryString() return "wsdl" or "WSDL" I
simply return the URL of a static WSDL file included in my web service.
Otherwise, I return control to parent class. Then, it works perfectly.
Here is the code sample :
package com.geopost.clp.cityssimo.wsapi.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.codehaus.xfire.spring.remoting.XFireExporter;
import org.springframework.web.servlet.ModelAndView;
public class WebServiceController extends XFireExporter {
/* (non-Javadoc)
* @see
org.codehaus.xfire.spring.remoting.XFireExporter#handleRequest(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
*/
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception {
ModelAndView returnModelAndView = null;
if ( "wsdl".equalsIgnoreCase(request.getQueryString())) {
returnModelAndView = new
ModelAndView("/WEB-INF/classes/META-INF/myWsdlFile.wsdl");
} else {
returnModelAndView = super.handleRequest(request,
response);
}
return returnModelAndView;
}
}
Christophe
"Dan Diephouse" <[EMAIL PROTECTED]>
08/12/2006 17:05
Veuillez répondre à user
Pour : [email protected]
cc :
Objet : Re: [xfire-user] [XMLBeans]How to customize WSDL
Generation without annotations
Hi Christophe,
You could look into the WSDLBuilder code in XFire. It allows you to
specify a WSDLBuilderExtension which can customize the WSDL. That will
only change the WSDL though, if that doesn't map to your service class and
how XFire expects the mapping to be, I'm not sure it will work.
I think you'd use it something like this:
XFire xfire = XFireFactory.newInstance().getXFire();
Service service = getServiceRegistry().getService("myservice")
wsdlBuilder = new WSDLBuilder(service, xfire.getTransportManager());
WSDLBuilderExtension myExtension = ...;
List exts = new ArrayList();
exts.add(myExtension);
wsdlBuilder.setExtensions(exts);
That kind of requires a little bit of knowledge of the XFire APIs though.
Hope that helps,
- Dan
On 12/6/06, [EMAIL PROTECTED] <
[EMAIL PROTECTED] > wrote:
Hi,
Is there any way to customize the WSDL generation in a XMLBeans-based Web
service ?
I know this kind of customization can be achieved by using JSR181
annotations, but I don't want to use it (because the project can't be
refactored now).
Is there any other way ?
Thanks in advance
PS: I use XFire1.2.1 and Spring 2.0 together on a jdk 1.4 platform.
Christophe
--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog