jaxbelement

How to JSON-marshal JAXBElement-wrapped responses without the JAXBElement wrapper?

旧街凉风 提交于 2019-12-18 17:02:28
问题 I have an http service that is using Spring (v4.0.5). Its http endpoints are configured using Spring Web MVC. The responses are JAXB2-anotated classes that are generated off of a schema. The responses are wrapped in JAXBElement as the generated JAXB classes do not sport @XmlRootElement annotations (and the schema cannot be modified to doctor this). I had to fight a bit with getting XML marshalling ti work; in any case, it is working. Now I am setting up JSON marshalling. What I am running

JAXB avoid JAXBElement<?>

末鹿安然 提交于 2019-12-18 04:01:47
问题 I want to generate Java classes with JAXB from a XSD file. The problem is, that I always get a few classes like this one (namespace removed): public static class Action { @XmlElementRefs({ @XmlElementRef(name = "ReportStateCanceled", namespace = "http://...", type = JAXBElement.class, required = false), @XmlElementRef(name = "ReportDate", namespace = "http://...", type = JAXBElement.class, required = false), @XmlElementRef(name = "ReportStatePreliminary", namespace = "http://...", type =

String type in WCF service interpreted as JAXBelement in JavaClient

别说谁变了你拦得住时间么 提交于 2019-12-12 03:47:02
问题 I have the following WCF web service: [ServiceContract] interface IService { [OperationContract] void SaveInwardDocument(InwardDocument document); } public class Serice:IService{ void SaveInwardDocument(InwardDocument document){...}; } [DataContract] public class InwardDocument{ [DataMember] public Citizen {get;set;} //some other enum properties [DataMember] public string Remarks {get;set;} } [DataContract] public class Citizen{ //Citizen proeperties } When I generate a proxy class in a java

JAXB avoid JAXBElement<?>

六眼飞鱼酱① 提交于 2019-11-29 03:48:04
I want to generate Java classes with JAXB from a XSD file. The problem is, that I always get a few classes like this one (namespace removed): public static class Action { @XmlElementRefs({ @XmlElementRef(name = "ReportStateCanceled", namespace = "http://...", type = JAXBElement.class, required = false), @XmlElementRef(name = "ReportDate", namespace = "http://...", type = JAXBElement.class, required = false), @XmlElementRef(name = "ReportStatePreliminary", namespace = "http://...", type = JAXBElement.class, required = false), @XmlElementRef(name = "DocumentID", namespace = "http://...", type =