On Fri, Jun 19, 2009 at 1:29 PM, liw <[email protected]> wrote:

>
> Hi, we are migrating from xfire to cxf. In xfire, we have the following
> code
> for generating wsdl.
>
>  XFire xfire = (XFire)BeanFactory.getBeanInstance("xfire");
>  Service origRegisteredService =
> xfire.getServiceRegistry().getService(serviceName);
>  origRegisteredService.getWSDLWriter().write(os);
>
> We need to migrate the above code from xfire to CXF.
>
> 1) Is JavaToWSDLProcessor.generate() the right API to use for generating
> wsdl in CXF?


Yes. You can also look at JavaToWSDLProcessor.generate(ServiceInfo service,
File output)  if you already
created a serviceInfo instance.


>
> 2) If so, given a serviceName, what are the APIs we need to use to get the
> ServiceInfo, so we can pass it to JavaToWSDLProcessor.generate() method?


JavaToWSDLProcessor uses serviceBuilder to create service . It only create
one serviceInfo for the given serviceClass.  So you can create ServiceInfo
first and pass it to the generate(serviceInfo, outputFile) api.
Dose this help ?


Jim.

Reply via email to