Hi Geert,

Do you have the JAX-WS API jar on your classpath? I think it is needed for
holders to work. If that doesn't work, try the JAX-WS generation profile:

http://xfire.codehaus.org/JAX-WS

Sorry for the extra work here. JAX-WS was released after 1.x started.
2.x(aka CXF) will have JAX-WS by default. Expect a release
announcement on our
first milestone in a couple days.

Regards,
- Dan

On 12/15/06, Geert Engels <[EMAIL PROTECTED]> wrote:


Using Ant wsgen task from xfire 1.2.3 against WSDL from
https://adwords.google.com/api/adwords/v8/CampaignService?wsdl I get:

    [wsgen] 15-Dec-2006 09:20:04 org.codehaus.xfire.gen.Wsdl11Generatorgenerate
    [wsgen] INFO: Generating code for WSDL at
file:/c:/work/workspace/bcp/src/etc/wsdl/ggl/CampaignService.wsdl with a
ba
e URI of file:/c:/work/workspace/bcp/src/etc/wsdl/ggl/CampaignService.wsdl
    [wsgen] 15-Dec-2006 09:20:04
org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator generate
    [wsgen] INFO: Creating class
com.teracode.bcp.api.ggl.CampaignInterface

BUILD FAILED
C:\work\workspace\bcp\build\build.xml:72: *
org.codehaus.xfire.gen.GenerationException: Could not find holder type.

*This seems to be the same as question posted on Nov 2nd here
http://www.mail-archive.com/[email protected]/msg01259.html to which
there never was a reply.*
*
Running the Ant task through a debugger, I can intercept an embedded
ClassCastException, which originates at line
org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.java:252.

The code there is as follows:

protected JType getHolderType(GenerationContext context,MessagePartInfo
part)
        throws GenerationException
    {
        JType genericType = context.getSchemaGenerator().getType(context,
part.getName(), part.getSchemaType().getSchemaType());

        try {
            JClass holder = context.getCodeModel().ref("
javax.xml.ws.Holder");
*            holder = holder.narrow((JClass) genericType); /* THIS IS
WHERE THE CLASSCASTEXCEPTION OCCURS */*
            return holder;
        } catch (Exception e) {
            throw new GenerationException("Could not find holder type.",
e);
        }
    }


The MessagePartInfo, when the ClassCast is thrown, contains a schemaType
which stringifies to "org.codehaus.xfire.aegis.type.basic.ObjectType
[class=<null>,
QName={https://adwords.google.com/api/adwords/v8}responseTime]";.

Anybody know how to get Xfire wsgen to work with this WSDL? All others
from WSDLs from Google AdWords API, not only this service but all others,
and not only v8 but v7 and v6 as well, fail in the same way.

Thanks !

Geert.





--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Reply via email to