Try adding a package-info.java to the annotated class, and fill in with
something similar to the following

@XmlSchema(namespace = "http://example.org/main-namespace";,
    elementFormDefault = XmlNsForm.QUALIFIED, xmlns = {
      @XmlNs(prefix = "my", namespaceURI = "
http://example.org/main-namespace";)
      @XmlNs(prefix = "other", namespaceURI = "
http://example.org/other-referred-namespace";)
    })
package my.package;

import javax.xml.bind.annotation.XmlNs;
import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.bind.annotation.XmlSchema;


consider that @XmlNs is only a "suggestion" and often it is ignored

Cristiano



2014-05-21 11:24 GMT+02:00 gquintana <[email protected]>:

> JAXB Bundle versions:
>
> Apache CXF Runtime JAXB DataBinding
> org.apache.cxf.cxf-rt-databinding-jaxb
>         2.6.6
> Apache ServiceMix :: Bundles :: jaxb-impl
> org.apache.servicemix.bundles.jaxb-impl
>         2.2.1.1_2
> Apache ServiceMix :: Bundles :: jaxb-xjc
> org.apache.servicemix.bundles.jaxb-xjc
>         2.2.1.1_2
>
>
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/Custom-namespace-prefix-in-JAXB-tp5720382p5720383.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>

Reply via email to