Вот мой xsd < /p>
12
< /code>
Когда я использую плагин XJC для генерации класса Java < /p>
@Setter
@Getter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"application"
})
@XmlRootElement(name = "BatchTotalsQuery", namespace = "https://transaction.elementexpress.com")
public class BatchTotalsQuery {
@XmlElement(name = "Application", namespace = "https://transaction.elementexpress.com", required = true)
protected Application application;
< /code>
xml получает сгенерирование как < /p>
20
< /code>
Я хочу, чтобы приложение XML было < /p>
20
How can I add the namespace to the root and also have it as "Application" instead of "application"
Tried to generate using jaxb maven plugin and also from intellij
Once the java classes are generated I use the below code to send xml to vendor
BatchTotalsQuery query = new BatchTotalsQuery();
Application application = new Application();
application.setApplicationID("20586");
query.setApplication(application);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_XML);
HttpEntity entity = new HttpEntity(query,headers);
restTemplate.postForObject("https://certtransaction.elementexpress.com", entity, Object.class);
Подробнее здесь: https://stackoverflow.com/questions/796 ... -as-in-xsd