CXF java2ws: how to include external xsd files?

I generate WSDL files for several web services (from server service definitions), where I already have XML schemas (* .XSD) for beans, used as parameters. How can I tell java2ws to reference them (including external XSD) and not generate my own in WSDL?

I tried -createxsdimports, but this creates its own XSD files.

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

+5
source share
2 answers

Try the @XmlSchemaabstract. It includes a parameter locationthat is used to indicate to JAXB that a real circuit exists:

@XmlSchema(location="http://www.example.com/xsds/foo.xsd")
package com.example.foo;
+4
source

I have a CXF Webservice that imports external schema files. When I built it; I spent a lot of time trying to figure out the exact scenario that you are trying to achieve. Unfortunately, it seems that CXF does not account for the @XmlSchema annotation (location = "") when creating WSDL from java. Daniel Kulp, CXF lead developer, told me that it was a known issue at the time, but it’s not enough for people to complain about it, so it’s not high on the list of priorities that need to be fixed.

, WSDL , SEI WSDL. , WSDL, , .

, , HTTP GET - SEI webservice - CXF , , , . ; , , CXF "myschema.xsd" http://myurl.com/myschema.xsd, /src/main/schema/myschema.xsd.

+2

All Articles