Код: Выделить всё
javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"d2LogicalModel"). Expected elements are
< /code>
Это код XML: < /p>
fr
Tipi
operatingMode3
2025-09-05T15:06:26.906+02:00
active
2025-09-05T15:06:26.906+02:00
snapshot
2736545
2025-09-05T15:06:26.906+02:00
fr
Tipi
< /code>
и код, чтобы Unmarshal it: < /p>
JAXBElement root;
JAXBContext jc = JAXBContext.newInstance(D2LogicalModel.class);
Unmarshaller unmarshaller = jc.createUnmarshaller();
MessageFactory mf = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
SOAPMessage soapMessage = mf.createMessage(null, is);
SOAPBody body = soapMessage.getSOAPBody();
root = (JAXBElement)unmarshaller.unmarshal(body.getFirstChild());
D2LogicalModel d2lm = root.getValue();
return d2lm;
< /code>
D2LogicalModelКод: Выделить всё
xjc -no-header -d schemas -b xsd/binding.xml xsd
< /code>
Class declaration is as follows:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "D2LogicalModel", propOrder = {
"exchange",
"payloadPublication",
"d2LogicalModelExtension"
})
public class D2LogicalModel {
// body omitted
}
< /code>
The helpful AI assistant tells me that the d2LogicalModelПодробнее здесь: https://stackoverflow.com/questions/797 ... lope-valid