You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Conficio <Ka...@Conficio.com> on 2011/11/15 17:52:10 UTC

How to do java first with imported XSD schema correctly?

Hi guys,
I'm working with CXF 2.4.3 on Java first web services (attached Eclipse
project  http://cxf.547215.n5.nabble.com/file/n4994906/CXF-WSDLTest.zip
CXF-WSDLTest.zip )  and can't get around the following error when attempting
to generate WSDL with referenced XSD files.

SEVERE: Schema element {urn:example.com:fault1}appFault references undefined
type {urn:example.com:fault}appFaultDetails for service
{urn:example.com:role1}RoleApiService.

I want/need to do this, because several services do share the Fault,
FaultDetails and error code beans.

Here are my questions:
* Why is java2ws not seeing the appFaultDetails (generating the severe
message above)?
* Why is java2ws not generating the import statement for the fault.xsd?
* Why is the import statement for the role.xsd not using the stated location
from the package-info.java file?

In addition how is the Validator coming up with the idea that this is valid
WSDL, when the Eclipse validation clearly shows it is not.

Thanks for helping me out on this one. Let me know if I'm doing something
odd/bad or if this is a bug in java2ws?

K<o>



--
View this message in context: http://cxf.547215.n5.nabble.com/How-to-do-java-first-with-imported-XSD-schema-correctly-tp4994906p4994906.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: How to do java first with imported XSD schema correctly?

Posted by Conficio <Ka...@Conficio.com>.
Thanks Daniel,
for confirming, it is not me attempting something totally wrong.

I created https://issues.apache.org/jira/browse/CXF-3918. Please let me know
if I can help, for example by structuring the sample as a test case.

K<o>

--
View this message in context: http://cxf.547215.n5.nabble.com/How-to-do-java-first-with-imported-XSD-schema-correctly-tp4994906p4998070.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: How to do java first with imported XSD schema correctly?

Posted by Daniel Kulp <dk...@apache.org>.
On Tuesday, November 15, 2011 8:52:10 AM Conficio wrote:
> Hi guys,
> I'm working with CXF 2.4.3 on Java first web services (attached Eclipse
> project  http://cxf.547215.n5.nabble.com/file/n4994906/CXF-WSDLTest.zip
> CXF-WSDLTest.zip )  and can't get around the following error when attempting
> to generate WSDL with referenced XSD files.
> 
> SEVERE: Schema element {urn:example.com:fault1}appFault references undefined
> type {urn:example.com:fault}appFaultDetails for service
> {urn:example.com:role1}RoleApiService.
> 
> I want/need to do this, because several services do share the Fault,
> FaultDetails and error code beans.
> 
> Here are my questions:
> * Why is java2ws not seeing the appFaultDetails (generating the severe
> message above)?
> * Why is java2ws not generating the import statement for the fault.xsd?
> * Why is the import statement for the role.xsd not using the stated location
> from the package-info.java file?

These are all related I think.   When we call the JAXBContext.generateSchmema 
method, it seems to only be calling back into the output resolver for the 
schemas it actually generates.   Kind of strange, but OK.   In your case, due 
to the package-info stuff, it's not generating those schemas.   Without that 
callback, currently, CXF doesn't know anything about it and it will fail to 
include those schemas into the resulting wsdl in any fassion. 

Definitely log a bug about this if you can.   It's going to require some 
thought about how to deal with it though.   In particular, a "runtime java 
first" case like this is going to require quite a bit of code to get the ?wsdl 
and ?xsd things to resolve correctly as it's a mixed bag of stuff with some 
stuff JAXB generated and some stuff provided.

 
> In addition how is the Validator coming up with the idea that this is valid
> WSDL, when the Eclipse validation clearly shows it is not.

CXF just validates the wsdl parts of it, not the schema. 

> Thanks for helping me out on this one. Let me know if I'm doing something
> odd/bad or if this is a bug in java2ws?

Bug, or restriction.

Dan


> 
> K<o>
> 
> 
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/How-to-do-java-first-with-imported-XSD-sche
> ma-correctly-tp4994906p4994906.html Sent from the cxf-user mailing list
> archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com