Это целевой метод, в котором мне нужно установить значение
Код: Выделить всё
public void setData(JAXBElement value) {
this.data = ((JAXBElement ) value);
}
Код: Выделить всё
ObjectFactory factory = new ObjectFactory();
JAXBElement jaxbElement = new JAXBElement(
new QName(ApplicationIngestionRequest.class.getSimpleName()), ApplicationIngestionRequest.class, request);
StringWriter writer = new StringWriter();
JAXBContext context = JAXBContext.newInstance(ApplicationIngestionRequest.class);
context.createMarshaller().marshal(jaxbElement, writer);
LOG.info("JAXBElement object :\n"+ writer.toString());
Unmarshaller u = context.createUnmarshaller();
JAXBElement o = (JAXBElement) u.unmarshal(new StringReader(writer));
Код: Выделить всё
0000005511
Код: Выделить всё
losRequest.setData(o.toString());
Подробнее здесь: https://stackoverflow.com/questions/297 ... using-java
Мобильная версия