jaxb

XSD Client in Spring

I have an XSD document that I need to communicate with an endpoint (client side only) - is there this functionality built into spring? I have been using JAXB, but was wondering if spring has some sort of wrapper. Thanks. ...

JAXB Unmarshall Created an Empty Object

I am using JAXB to unmarshal an XML file into an object tree. The root object is non-null, but all of it's members are null even though there is data in the XML file. My object classes were generated with Axis2 from wsdls. I have the ObjectFactory class, the jaxb.index class, the package.info annotation, etc. My problem is the same a...

Correct use of WSDL-generated sources

How can I easily convert between manually written classes and WSDL-generated equivalents? I have a Java SE 6 thick client that calls a web service to get and store data. The client has a DAO that works with my entity classes, calls <Entity>.toDto() to convert them to DTOs, and sends/receives that data with the web service. My issue stem...

How to configure IntelliJ IDEA and/or Maven to automatically add directories with Java source code generated using jaxb2-maven-plugin?

In our project we are using jaxb2-maven-plugin to generate Java source code from XML Schema, which causes that our Maven module requires additional source code directory (in our case target/generated/main/java). Up to date I've been using Eclipse and maven-eclipse-plugin to import all the projects into Eclipse workspace. The plugin is (s...

What to use instead validator in jaxb 2.0

JAXB version 1 spec have a Validator object, in version 2 Validator object was depricated and optional. What i need to use instead Validator object? Thanks! ...

JAXB, Netbeans and Interface Insertion Plugin

Hi, I can't get my generated classes to implements any interface. This is my xml schema file: xmlns:jxb="http://java.sun.com/xml/ns/jaxb/" xmlns:ai="http://jaxb.dev.java.net/plugin/if_insertion" jxb:extensionBindingPrefixes="ai" > <xs:element name="header"> <xs:annotation> <...

Amazon EC2 and jbossws

Hi - I've deployed a webservice to a Jboss instance running on Amazon EC2. The webservice works fine locally, but when I deploy on EC2, and go to the /jbossws/services page the Endpoint Address for the webservice is the private DNS of the ec2 instance (domU-X-X-X-X etc...), not the public dns (which I would like it to be). I've tried ...

Do you always need an ObjectFactory class when using JAXB?

Do you always need an ObjectFactory class when using JAXB? Without it I get this exception: javax.xml.bind.JAXBException: "com.a.b.c" doesnt contain ObjectFactory.class or jaxb.index I gather the ObjectFactory can be overkill. But given this exception I'm guessing you need it.. but not sure why? ...

Representing element as boolean with JAXB?

We have this XML: <Summary> <ValueA>xxx</ValueA> <ValueB/> </Summary> <ValueB/> will never have any attributes or inner elements. It's a boolean type element - it exists (true) or it doesn't (false). JAXB generated a Summary class with a String valueA member, which is good. But for ValueB, JAXB generated a ValueB inne...

JAXB required=true doesn't seem to require

We have this JAXB annotation: @XmlElement(name = "Strategy", required = true) protected List<Strategy> strategy; If there are no Strategy elements present, no exception is thrown.. why is this? Shouldn't we get an exception? ...

JAX-WS with JAXB tutorial

I'm getting started in developing web services using JAX-WS. I'm trying to implement classes I can send between my service and client using JAXB, but having trouble getting it to work. I've tried following the example at this site but cannot seem to get it to work. After following the instructions, the test page that's displayed doesn't...

Tomcat JAXB 1 and 2 linkage error

I'm running a tomcat 6, spring, apache cxf webservice, know it is a must to add one third party library to my webapp to fulfill an order. I have jaxb-impl-2.1.12.jar for apache cxf in WEB-INF/lib folder and the new library which contains the JAXB 1.0 runtime. JAXB 2 ist used by apache cxf for dynamic clients (i need them). So is there...

Java Web Services/JAXB - Abstract superclass

I have a package with JAXB annotated classes with an abstract superclass. I want to use this superclass in web service interface, so I can pass any of subclasses as a parameter. When I do it, an exception is thrown: javax.xml.ws.WebServiceException: javax.xml.bind.UnmarshalException - with linked exception: [javax.xml.bind.UnmarshalExce...

need an empty XML while unmarshalling a JAXB annotated class

I have a JAXB annotated class Customer as follows @XmlRootElement(namespace = "http://www.abc.com/customer") public class Customer{ private String name; private Address address; @XmlTransient private HashSet set = new HashSet<String>(); public String getName(){ return name; } @XmlElement(name = "Name", namespace = "http://www.abc.c...

JAXB does not call setter when unmarshalling objects

Hi all, I am using JAXB 2.0 JDK 6 in order to unmarshall an XML instance into POJOs. In order to add some custom validation I have inserted a validation call into the setter of a property, yet despite it being private, it seems that the unmarshaller does not call the setter but directly modifies the private field. It is crucial to me...

Spring MVC 3.0: Avoiding explicit JAXBElement<> wrapper in method arg

I have the following method and want to avoid having to explicitly show the JAXBElement<> syntax. Is there some sort of annotation that would allow the method to appear to accept raw MessageResponse objects but in actuality work the same as shown below? I'm not sure how clear that was so I'll say this: I'm looking for some syntactic suga...

Using JAXB and skipping an element

We have XML such as shown below. We have a corresponding Team, Players, and Player Java classes. We use JAXB to unmarshall the XML. <team> <players> <player> <name>Le Bron</name> <age>23</age> </player> <player> <name>Shaq</name> <age>33</age> </player> </players> </...

Missing JAXB classes from XMLschema.xsd

Hi, I'm working on a xml schema resolver and I'm using JAXB with XMLSchema.xsd. I experience problems with JAXB, because I don't get classes for all the top level elements. For example for <xs:element name="maxLength" id="maxLength" type="xs:numFacet"> I do not get a class MaxLength or anything like that. Only NumFacet exists. Anyo...

Resolve naming conflict in included XSDs for JAXB compilation

I am currently trying to compile with JAXB (IBM build 2.1.3) a pair of schema files into the same package. Each will compile on it's own, but when trying to compile them together i get a element naming conflict due to includes. My question is; is there a way to specify with an external binding a resolution to the naming collision. Exa...

XML Schema to Java Classes with XJC

I am using xjc to generate Java classes from the XML schema and the following is an excerpt of the XSD. <xs:element name="NameInfo"> <xs:complexType> <xs:sequence> <xs:choice> <xs:element ref="UnstructuredName"/> <!-- This line --> <xs:sequence> <xs:element ref="StructuredName"/> <xs:eleme...