Questions tagged [jaxbelement]

Java EE JAXB representation of an Xml Element. This class represents information about an Xml Element from both the element declaration within a schema and the element instance value within an xml document with the following properties

JAXB representation of an Xml Element.

This class represents information about an Xml Element from both the element declaration within a schema and the element instance value within an xml document with the following properties:

  • element's xml tag name
  • value represents the element instance's atttribute(s) and content model
  • element declaration's declaredType (xs:element @type attribute)
  • scope of element declaration
  • boolean nil property. (element instance's xsi:nil attribute)
37 questions
14
votes
2 answers

JAXB avoid JAXBElement

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 =…
DanyX23
  • 308
  • 1
  • 2
  • 9
9
votes
2 answers

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

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…
gv0tch0
  • 391
  • 1
  • 2
  • 14
5
votes
1 answer

JAXBElementRef does not generate nillable="true"

for the request for my web service, I wanted to differ between requested null value and missing tag. In other words I needed the following element definition: I…
user1414745
  • 1,317
  • 6
  • 25
  • 45
4
votes
2 answers

How do I serialize a JAXBElement?

I am using: GSON 2.3.1 apache-cxf-3.1.1 JBoss EAP 6.4 I am using wsdl2java to create webservice client from wsdl. I generate the classes with: @XmlElementRef(name = "FMLA_Code", namespace = "http://www.ultipro.com/contracts", type =…
klind
  • 855
  • 2
  • 21
  • 33
4
votes
2 answers

JAXB generates List instead of fields

I'm trying to generate a class with the jaxb maven plugin from the following wsdl:
Rick Slot
  • 156
  • 1
  • 7
3
votes
1 answer

JAXB generate nillable = "true" from java

it this a bug? I need nillable = "true" in my xsd schema. The only way to generate such an element from my java code is to use @XmlElement(nillable = true), right? But in this case, I will not be able to take advantage of this definition, I will not…
user1414745
  • 1,317
  • 6
  • 25
  • 45
2
votes
1 answer

JAXBElement initialization - Java Spring Boot 2

I have to initialize an element of type JAXBElement , I have tried as follows: JAXBElement element = new JAXBElement<>(new QName("http://tempuri.org/", "FieldName"), String.class, "FieldData"); But I am not sure if it is the correct…
Despotars
  • 541
  • 1
  • 8
  • 23
2
votes
1 answer

How to Instantiate and store values in List>

I have generated java client from a Wsdl. I am stuck at following code where I have to set some setters values in following List> public class SampleVerificationDomain extends BaseDomain { protected…
2
votes
1 answer

Getting java.lang.ClassCastException: javax.xml.bind.JAXBElement cannot be cast to com.[mySchema] when implementing the ItemProcessor

so I am creating my first Spring batch job. I am trying to read in an xml, manipulate some values, and write it out. My job seems to unmarshal my XML document and write it out fine if I do not implement the…
2
votes
3 answers

Can't map property String to JAXBElement using MapStruct

so I was playing a bit with Mapstruct, reading the reference Documentation for the Version 1.1.0.Final, and arrived at the point: implicit type conversions where is defined the following statement: Between JAXBElement < T> and T I tried that, but…
David Laci
  • 146
  • 1
  • 12
2
votes
1 answer

What can cause @XmlRootElement classes to be unmarshalled into JaxbElement?

I am currently trying to unmarshal an XML document via JAXB. I've already have generated the JAXB classes within my project, and have a root class annotated with @XmlRootElement. Unfortunately, when I attempt to unmarshal, I receive the following…
Patrick
  • 21
  • 2
2
votes
1 answer

Issues with JSON processing using JAXBElement under Jersey 2.2 with MOXy

I extended the jersey-examples-moxy code to use an XML schema definition instead of the JAXB annotated beans. The xjc compiled XML schema produces XML and JSON encodings identical to the original example. I followed the jersey instructions and used…
Hacksaw
  • 69
  • 1
  • 13
2
votes
1 answer

how to get Store JAXBelement to String?

Hello I want to Store JAXBelement value to String variable how to do this kindly tell me please. I have Following method . public JAXBElement getSessionId() { return sessionId; } above method is in sessiondata class. i have create…
Kapil
  • 320
  • 6
  • 10
  • 23
1
vote
0 answers

JAXBException error while external SOAP web service

The service is made to consume an external soap web service. Despite having set the configs as shown below: public class Test extends WebServiceGatewaySupport { public JAXBElement callWebService(String url, JAXBElement request){ …
1
vote
0 answers

SOAP call by WebClient Content type 'text/xml' not supported

I tried to make a SOAP call from spring reactive webclient. the ConfirmPayer10, ConfirmPayer10Response and ObjectFactory classes i generated from wsdl file by the maven-jaxb2-plugin plugin. for the encoder and decoder config, i get the same from…
Aymen Kanzari
  • 1,765
  • 7
  • 41
  • 73
1
2 3