Feeds ToolContext with "ToolConstants.CFG_WSDL", it will add the
WSDLGenerator .
Jim.
On Fri, Jul 10, 2009 at 2:02 AM, liw <
pattiewang@...> wrote:
>
> Hi Jim,
>
> It was turned out that the generators list is empty when
> JavaToWSDLProcessor.generate() API is invoked. That's why the wsdl file is
> empty.
>
> The service is build from spring bean definition. I am able to generate
> wsdl
> using WSDLWriter.
>
> Thanks for your inputs,
>
> Li
>
> jim ma wrote:
> >
> > On Thu, Jul 9, 2009 at 7:50 AM, liw <
pattiewang@...> wrote:
> >
> >>
> >> Hi Jim,
> >>
> >> Since I have the service object already, is there any way that I can get
> >> the
> >> ServiceInfo for the service instead of creating a one?
> >>
> >> If I have to create a ServiceInfo instance, what are the minimum fields
> I
> >> need to add before passing it to JavaToWSDLProcessor.
> >>
> >
> > yes. you can . What is this service built from ? Do you use
> > ReflectionServiceFactoryBean to build it ?
> >
> >
> >>
> >>
> >> Here is the code I have. Unfortunately, the wdl file generated is empty.
> >>
> >>
> >> private void generateCXFWsdlStream(String serviceName, OutputStream os)
> >> throws IOException
> >> {
> >> Service service = getCXFServiceObject(serviceName);
> >> List serviceInfos = service.getServiceInfos();
> >>
> >> for (ServiceInfo serviceInfo : service.getServiceInfos()) {
> >> System.out.println("serviceInfo targetNamespace" +
> >> serviceInfo.getTargetNamespace());
> >> }
> >>
> >> File tempFile = new File(outdir, serviceName + ".wsdl");
> >> JavaToWSDLProcessor wsdlProcessor = new JavaToWSDLProcessor();
> >>
> >> wsdlProcessor.generate((ServiceInfo)
> >> serviceInfos.get(0),tempFile);
> >> }
> >>
> >
> > Did you see some errors when you generate wsdl ? The JavaToWSDLprocessor
> > will invoke ServiceWSDLBuilder to convert the ServiceInfo to Wsdl
> > definition. You can debug this class to get more information.
> >
> >
> > Jim.
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/How-to-generate-wsdl-programmatically-using-cxf--tp24105734p24415033.html> Sent from the cxf-user mailing list archive at Nabble.com.
>
>