JAXB binding file: XmlAdapters and package name

前端 未结 5 1006
渐次进展
渐次进展 2021-02-04 04:45

I have a binding file like this



        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-04 05:00

    For Apache CXF users, the cleanest way is to use the -p option offered by wsdl2java.

    -p [wsdl-namespace=]PackageName

    Specifies zero, or more, package names to use for the generated code. Optionally specifies the WSDL namespace to package name mapping.

    In our case

    -p http://www.w3.org/2001/XMLSchema=org.acme.foo

    If you use the cxf-codegen-plugin, then just add another pair of .

    
        org.apache.cxf
        cxf-codegen-plugin
        ${cxf.version}
            [...]
        -p
        http://www.w3.org/2001/XMLSchema=org.acme.foo
            [...]
    
    

    No need for a targetNamespace pointing at the reserved XSD namespace and no need for catch-all jaxb package binding.

提交回复
热议问题