Skip to content
Advertisement

Tag: jaxb

jaxb namespace gives unneeded ns2 prefix

I need to generate the namespace into the xml, but this leads to an inconsistent ns2 prefixing that I don’t need (I don’t have mixed namespaces). I tried several solutions i found with no luck. package-info.java POJO marshaller call result Answer The namespace prefix is needed, since you have elements like <subtag> without a namespace. Once you assign a namespace

How to use setters in JAXB collections unmarshalling

I wan’t to deserialize XML to my POJO but something doing wrong… My POJO class: Marshalling example: XML output: Unmarshalling example: Console output: As you can see, citiesId is empty. It happens because JAXB unmarshalling calling the getter (copy of field in my case) and trying to set values into a copy of collection. How to make it create a

JaxbDto Serialization and deserialization

I need to receive some message with SOAP so I’ve generated a few classes by xsd-scheme and maven-jaxb2-plugin like this: After receiving message I need to send these to the next one microservice in wrap of HashMap. I supposed to use ObjectMapper to convert: But the generated classes are haven’t any constructors so I got the exception like ” No

Quarkus classLoader conflicts

I am facing an error while trying to build my quarkus app. It seems to be related to the fact that there are two class loaders that have different class objects for javax/xml/namespace/QName as it is noticed in this part of the stack-trace : Caused by: java.lang.LinkageError: loader constraint violation: when resolving field “DATETIME” the class loader (instance of io/quarkus/bootstrap/classloading/QuarkusClassLoader)

XML to java object using jaxb Unmarshalling namespace

I have below employee.xml which I am trying to convert to Java Object using JAXB. I am getting null value here, please guide me what I am missing here or doing wrong. I am not familiar with JAXB and namespace <employee xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns=”http://schema.cs.csg.com/cs/ib/cpm”> I thing I am missing some annotation or not using it properly. Output: employee.xml Employee.java Department.java

Convert Soap XML response to Object

i’m new to working with SOAP API’s I have a soap response from an API I’m trying to transform this into an object. From reading articles online I’m trying to use JAXB to do this, but my object is empty. Here’s the code for reading the response. I wrote the response to an xml file for test purposes: The LoginResult

Advertisement