users@jaxb.java.net

Re: undefined element declaration using xjc api

From: Ed Mooney <Ed.Mooney_at_Sun.COM>
Date: Mon, 14 Aug 2006 12:24:43 -0400

Hi Dan,

I tried passing this to wsimport (JAX-WS 2.0) and got a similar result:

$ bin\wsimport -httpproxy:webcache.east:8080
http://openskyquery.net/Sky/SkyPortal/SkyPortal.asmx?WSDL
warning: src-resolve: Cannot resolve the name 's:schema' to a(n)
'element declaration' component.
   line ? of
http://openskyquery.net/Sky/SkyPortal/SkyPortal.asmx?WSDL#types?schema1
error: undefined element declaration 's:schema'
   line 0 of
http://openskyquery.net/Sky/SkyPortal/SkyPortal.asmx?WSDL#types?schema1
error: undefined element declaration 's:schema'
   line 0 of
http://openskyquery.net/Sky/SkyPortal/SkyPortal.asmx?WSDL#types?schema1
error: undefined element declaration 's:schema'
   line 0 of
http://openskyquery.net/Sky/SkyPortal/SkyPortal.asmx?WSDL#types?schema1

My guess is that the web service is not returning
xmlns:s="http://www.w3.org/2001/XMLSchema" as part of the wsdl:definitions.

   -- Ed

Dan Diephouse wrote:
> Hiya,
> We're using the JAXB RI within XFire with our WSDL->Java generator. We
> pass in each schema Element to the Shema compiler.
>
> However, we're having problems with this WSDL:
> http://openskyquery.net/Sky/SkyPortal/SkyPortal.asmx?WSDL The compiler
> is complaining
>
> 0 [main] INFO org.codehaus.xfire.gen.Wsdl11Generator - Generating
> code for WSDL at
> file:/c:/cygwin/home/dan/xfire/xfire-generator/src/wsdl/SkyPortal.wsdl
> with a base URI of
> file:/c:/cygwin/home/dan/xfire/xfire-generator/src/wsdl/SkyPortal.wsdl
> 962 [main] WARN org.codehaus.xfire.gen.jaxb.ErrorReceiverImpl -
> src-resolve: Cannot resolve the name 's1:selectType' to a(n) 'type
> definition' component. at -1,-1 in
> file:/c:/cygwin/home/dan/xfire/xfire-generator/src/wsdl/SkyPortal.wsdl#types?schema1
>
> 962 [main] WARN org.codehaus.xfire.gen.jaxb.ErrorReceiverImpl -
> src-resolve: Cannot resolve the name 's:schema' to a(n) 'element
> declaration' component. at -1,-1 in
> file:/c:/cygwin/home/dan/xfire/xfire-generator/src/wsdl/SkyPortal.wsdl#types?schema1
>
> 962 [main] WARN org.codehaus.xfire.gen.jaxb.ErrorReceiverImpl -
> src-resolve: Cannot resolve the name 's4:VOTABLE' to a(n) 'type
> definition' component. at -1,-1 in
> file:/c:/cygwin/home/dan/xfire/xfire-generator/src/wsdl/SkyPortal.wsdl#types?schema1
>
> 1503 [main] ERROR org.codehaus.xfire.gen.jaxb.ErrorReceiverImpl -
> undefined element declaration 's:schema' at 0,0 in
> file:/c:/cygwin/home/dan/xfire/xfire-generator/src/wsdl/SkyPortal.wsdl#types?schema1
>
> 1503 [main] ERROR org.codehaus.xfire.gen.jaxb.ErrorReceiverImpl -
> undefined element declaration 's:schema' at 0,0 in
> file:/c:/cygwin/home/dan/xfire/xfire-generator/src/wsdl/SkyPortal.wsdl#types?schema1
>
> 1503 [main] ERROR org.codehaus.xfire.gen.jaxb.ErrorReceiverImpl -
> undefined element declaration 's:schema' at 0,0 in
> file:/c:/cygwin/home/dan/xfire/xfire-generator/src/wsdl/SkyPortal.wsdl#types?schema1
>
>
> I've digging through the JAXB source and still can't make heads or tails
> of the error message. As far as I can tell each schema/wsdl is correct.
> I think it is the <import namespace=""/> statements that is confusing
> things. For each import the entity resolver is being called with a null
> systemId and a publicId of the namespace in the import statement. Can
> anyone provide any insight into what might be going on?
>
> Cheers,
> - Dan
>