Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CXF java2ws: how to include external xsd files?

Tags:

java

jaxb

cxf

jaxb2

I generate WSDL files for several web services (from the server service definitions) where I have already XML schemas (*.XSD) for the beans used as parameters. How do I tell java2ws to reference these (include the external XSD) and not generate its own into the WSDL?

I have tried the -createxsdimports, but that does generate its own XSD files.

Is there a Java Annotation that I can use to let CXF know where the XSD for each file/package is?

like image 464
PlanBForOpenOffice Avatar asked Jul 14 '11 17:07

PlanBForOpenOffice


1 Answers

Try the @XmlSchema annotation. It includes a location parameter that is used to tell JAXB that a real schema exists:

@XmlSchema(location="http://www.example.com/xsds/foo.xsd")
package com.example.foo;
like image 59
bdoughan Avatar answered Sep 30 '22 14:09

bdoughan