Non riesco a visualizzare in un file xml tutti i parametri configurati con l'annotazione @xmlSchema a livello di pacchetto. Per esempio, se ho impostato:@xmlSchema annotazione utilizzata con jaxb
@javax.xml.bind.annotation.XmlSchema (
xmlns = {
@javax.xml.bind.annotation.XmlNs(prefix = "com",
namespaceURI="http://es.indra.transporte.common"),
@javax.xml.bind.annotation.XmlNs(prefix = "xsi",
namespaceURI="http://www.w3.org/2001/XMLSchema-instance"),
@javax.xml.bind.annotation.XmlNs(prefix = "ns2",
namespaceURI="http://es.indra.transporte.configuration"),
},
location = "http://es.indra.transporte.configuration StationNetwork.xsd",
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED
)
package es.indra.transporte.central.thalesinterface.common.beans;
mi aspetto di vedere qualcosa di simile:
<stationNetwork xmlns:ns2="http://es.indra.transporte.configuration"
xmlns:com="http://es.indra.transporte.common"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://es.indra.transporte.configuration StationNetwork.xsd">
ma ottengo il seguente output:
<stationNetwork xmlns:com="http://es.indra.transporte.common">
Quello che sto facendo di sbagliato? Come posso ottenere l'output atteso?
Come faccio a impostare gli xmlns sul nodo radice con le annotazioni? Ritorno dal mio metodo @Get con Response.ok (entity) .build(), e non sto usando direttamente il marshaller. – neu242
Non importa, @XmlSchema in package-info.java funzionava alla grande. – neu242