Search Results

Search found 252 results on 11 pages for 'jaxb'.

Page 3/11 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • how to Use JAXWS/JAXB rename the parameter

    - by shrimpy
    I use CXF(2.2.3) to compile the Amazon Web Service WSDL (http://s3.amazonaws.com/ec2-downloads/2009-07-15.ec2.wsdl) But got error as below. Parameter: snapshotSet already exists for method describeSnapshots but of type com.amazonaws.ec2.doc._2009_07_15.DescribeSnapshotsSetType instead of com.amazonaws.ec2.doc._2009_07_15.DescribeSnapshotsSetResponseType. Use a JAXWS/JAXB binding customization to rename the parameter. The conflict was due to the data type show below: <xs:complexType name="DescribeSnapshotsType"> <xs:sequence> <xs:element name="snapshotSet" type="tns:DescribeSnapshotsSetType"/> </xs:sequence> </xs:complexType> <xs:complexType name="DescribeSnapshotsResponseType"> <xs:sequence> <xs:element name="requestId" type="xs:string"/> <xs:element name="snapshotSet" type="tns:DescribeSnapshotsSetResponseType"/> </xs:sequence> </xs:complexType> I create a binding file try to address the issue...but it didn`t do the job <jaxws:bindings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" wsdlLocation="EC2_2009-07-15.wsdl" xmlns="http://java.sun.com/xml/ns/jaxws" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"> <enableWrapperStyle>false</enableWrapperStyle> <jaxws:bindings node="wsdl:definitions/wsdl:types/xs:schema[@targetNamespace='http://ec2.amazonaws.com/doc/2009-07-15/']"> <jxb:bindings node="xs:complexType[@name='tns:DescribeSnapshotsType']//xs:element[@name='snapshotSet']"> <jxb:property name="snapshotRequestSet"/> </jxb:bindings> <jxb:bindings node="xs:complexType[@name='DescribeSnapshotsResponseType']//xs:element[@name='snapshotSet']"> <jxb:property name="snapshotResponseSet"/> </jxb:bindings> </jaxws:bindings> </jaxws:bindings> And the command i used, was like below <wsdlOptions> <wsdlOption> <wsdl>${basedir}/src/main/resources/wsdl/EC2_2009-07-15.wsdl</wsdl> <extraargs> <extraarg>-b</extraarg> <extraarg>${basedir}/src/main/resources/wsdl/Bindings_EC2_2009-07-15.xml</extraarg> </extraargs> </wsdlOption> </wsdlOptions> What is wrong with my code???? And you can check out my project by using svn.... svn co http://shrimpysprojects.googlecode.com/svn/trunk/smartcrc/AWSAgent/

    Read the article

  • Clickatell SOAP wsdl to JAXB java classes

    - by timvb
    Hi all, I'm trying to generate JAXB classes from the Clickatell wsdl: You can find the wsdl definition here it quite large: http://api.clickatell.com/soap/webservice.php?WSDL When trying to generate java classes from this Wsdl i got the following errors: [ERROR] undefined simple or complex type 'SOAP-ENC:Array' [ERROR] undefined attribute 'SOAP-ENC:arrayType' I hope someone can help me out. Cheers, Tim

    Read the article

  • Validating against a Schema with JAXB

    - by fwgx
    I've been looking for solutions to this problem for far too long considering how easy it sounds so I've come for some help. I have an XML Schema which I have used with xjc to create my JAXB binding. This works fine when the XML is well formed. Unfortunately it also doesn't complain when the XML is not well formed. I cannot figure out how to do proper full validation against the schema when I try to unmarshall an XML file. I have managed to use a ValidationEventCollector to handle events, which works for XML parsing errors such as mismatched tags but doesn't raise any events when there is a tag that is required but is completely absent. From what I have seen validation can be done againsta schema, but you must know the path to the schema in order to pass it into the setSchema() method. The problem I have is that the path to the schema is stored in the XML header and I can't knwo at run time where the schema is going to be. Which is why it's stored in the XML file: <?xml version="1.0" encoding="utf-8"?> <DDSSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/a/big/long/path/to/a/schema/file/DDSSettings.xsd"> <Field1>1</Field1> <Field2>-1</Field2> ...etc Every example I see uses setValidating(true), which is now deprecated, so throws an exception. This is the Java code I have so far, which seems to only do XML validation, not schema validation: try { JAXBContext jc = new JAXBContext() { private final JAXBContext jaxbContext = JAXBContext.newInstance("blah"); @Override public Unmarshaller createUnmarshaller() throws JAXBException { Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); ValidationEventCollector vec = new ValidationEventCollector() { @Override public boolean handleEvent(ValidationEvent event) throws RuntimeException { ValidationEventLocator vel = event.getLocator(); if (event.getSeverity() == event.ERROR || event.getSeverity() == event.FATAL_ERROR) { String error = "XML Validation Exception: " + event.getMessage() + " at row: " + vel.getLineNumber() + " column: " + vel.getColumnNumber(); System.out.println(error); } m_unmarshallingOk = false; return false; } }; unmarshaller.setEventHandler(vec); return unmarshaller; } @Override public Marshaller createMarshaller() throws JAXBException { throw new UnsupportedOperationException("Not supported yet."); } @Override @SuppressWarnings("deprecation") public Validator createValidator() throws JAXBException { throw new UnsupportedOperationException("Not supported yet."); } }; Unmarshaller unmarshaller = jc.createUnmarshaller(); m_ddsSettings = (com.ultra.DDSSettings)unmarshaller.unmarshal(new File(xmlfileName)); } catch (UnmarshalException ex) { Logger.getLogger(UniversalDomainParticipant.class.getName()).log( Level.SEVERE, null, ex); } catch (JAXBException ex) { Logger.getLogger(UniversalDomainParticipant.class.getName()).log( Level.SEVERE, null, ex); } So what is the proper way to do this validation? I was expecting there to be a validate() method on the JAXB generated classes, but I guess that would be too simple for Java.

    Read the article

  • JAXB unmarshal exclude specific element

    - by zigomir
    Hi everyone! I know for @XmlTransient annotation, but sometimes I need this element and in other use cases I really have to prevent it from unmarshaling, because it contains base64 text. So I need to exclude it because performance problems. Is there any way to dynamicly exclude one element from unmarshaling with JAXB?

    Read the article

  • How to remove not required Elements from generated XML via jaxb

    - by Dangling Piyush
    I want to know if there is anyway for removing not required elements from generated xml using jaxb.I have my xsd element definition as follows. <xsd:element name="Title" maxOccurs="1" minOccurs="0"> <xsd:annotation> <xsd:documentation> A name given to the digital record. </xsd:documentation> </xsd:annotation> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:minLength value="1"></xsd:minLength> </xsd:restriction> </xsd:simpleType> </xsd:element> As you can see it is not a mandatory element because minOccurs="0" But if it is not empty the length should be 1. <xsd:minLength value="1"></xsd:minLength> At the time of marshalling if I left the Title field blank it is throwing the SAXException because of min-length restriction. So what I want to do is to remove the whole occurrence of <Title/> from generated XML.Right now i have removed the min-length restriction so it is adding the <Title> element as EMPTY <Title></Title> But I do not want it like this.Any help is appreciated.I am using jaxb 2.0 for Marshalling. UPDATE: Following is my variable definiton : private JAXBContext jaxbContext; private Unmarshaller unmarshaller; private SchemaFactory factory; private Schema schema; private Marshaller marshaller; Marshalling code. jaxbContext = JAXBContext.newInstance(ERecordType.class); marshaller = jaxbContext.createMarshaller(); factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); schema = factory.newSchema((new File(xsdLocation))); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); ERecordType e = new ERecordType(); e.setCataloging(rc); /** * Validate Against Schema. */ marshaller.setSchema(schema); /** * Marshal will throw an exception if XML not validated against * schema. */ marshaller.marshal(e, System.out);

    Read the article

  • Can JAXB generate a generic class?

    - by dinesh
    Can I get JAXB 2.0 XJC compiler to generate a generic class for me? Something as simple as:- public class Shape<T> { T myShape; // getter / setter } I see references for this in the spec but am not sure I'm reading it right. I always get Object references.

    Read the article

  • Trimmed down JAXB for just unmarshalling?

    - by fiXedd
    I'm building an application where space is at a premium. I'd really like to use JAXB's unmarshalling capabilities, but including the whole library is out of the question. Has anyone paired it down so that only the bits needed for unmarshalling are included?

    Read the article

  • JAXB doesn't unmarshal list of interfaces

    - by Joker_vD
    It seems JAXB can't read what it writes. Consider the following code: interface IFoo { void jump(); } @XmlRootElement class Bar implements IFoo { @XmlElement public String y; public Bar() { y = ""; } public Bar(String y) { this.y = y; } @Override public void jump() { System.out.println(y); } } @XmlRootElement class Baz implements IFoo { @XmlElement public int x; public Baz() { x = 0; } public Baz(int x) { this.x = x; } @Override public void jump() { System.out.println(x); } } @XmlRootElement public class Holder { private List<IFoo> things; public Holder() { things = new ArrayList<>(); } @XmlElementWrapper @XmlAnyElement public List<IFoo> getThings() { return things; } public void addThing(IFoo thing) { things.add(thing); } } // ... try { JAXBContext context = JAXBContext.newInstance(Holder.class, Bar.class, Baz.class); Holder holder = new Holder(); holder.addThing(new Bar("1")); holder.addThing(new Baz(2)); holder.addThing(new Baz(3)); for (IFoo thing : holder.getThings()) { thing.jump(); } StringWriter s = new StringWriter(); context.createMarshaller().marshal(holder, s); String data = s.toString(); System.out.println(data); StringReader t = new StringReader(data); Holder holder2 = (Holder)context.createUnmarshaller().unmarshal(t); for (IFoo thing : holder2.getThings()) { thing.jump(); } } catch (Exception e) { System.err.println(e.getMessage()); } It's a simplified example, of course. The point is that I have to store two very differently implemented classes, Bar and Baz, in one collection. Well, I observed that they have pretty similar public interface, so I created an interface IFoo and made them two to implement it. Now, I want to have tools to save and load this collection to/from XML. Unfortunately, this code doesn't quite work: the collection is saved, but then it cannot be loaded! The intended output is 1 2 3 some xml 1 2 3 But unfortunately, the actual output is 1 2 3 some xml com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to testapplication1.IFoo Apparently, I need to use the annotations in a different way? Or to give up on JAXB and look for something else? I, well, can write "XMLNode toXML()" method for all classes I wan't to (de)marshal, but...

    Read the article

  • Use JAXB unmarshalling in Weblogic Server

    - by Leo
    Especifications: - Server: Weblogic 9.2 fixed by customer. - Webservices defined by wsdl and xsd files fixed by customer; not modifications allowed. Hi, In the project we need to develope a mail system. This must do common work with the webservice. We create a Bean who recieves an auto-generated class from non-root xsd element (not wsdl); this bean do this common work. The mail system recieves a xml with elements defined in xsd file and we need to drop this elements info to wsdlc generated classes. With this objects we can use this common bean. Is not possible to redirect the mail request to the webservice. We've looking for the code to do this with WL9.2 resources but we don't found anything. At the moment we've tried to use JAXB for this unmarshalling: JAXBContext c = JAXBContext.newInstance(new Class[]{WasteDCSType.class}); Unmarshaller u = c.createUnmarshaller(); WasteDCSType w = u.unmarshal(waste, WasteDCSType.class).getValue(); waste variable is an DOM Element object. It isn't the root element 'cause the root isn't included in XSD First we needed to add no-arg constructor in some autogenerated classes. No problem, we solved this and finally we unmarshalled the xml without error Exceptions. But we had problems with the attributes. The unmarshalling didn't set attributes; none of them in any class, not simple attributes, not large or short enumeration attributes. No problem with xml elements of any type. We can't create the unmarshaller from "context string" (the package name) 'cause not ObjectFactory has been create by wsldc. If we set the schema no element descriptions are founded and unmarshall crashes. This is the build content: <taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask" /> <taskdef name="wsdlc" classname="weblogic.wsee.tools.anttasks.WsdlcTask"/> <target name="generate-from-wsdl"> <wsdlc srcWsdl="${src.dir}/wsdls/e3s-environmentalMasterData.wsdl" destJwsDir="${src.dir}/webservices" destImplDir="${src.dir}/webservices" packageName="org.arc.eterws.generated" /> <wsdlc srcWsdl="${src.dir}/wsdls/e3s-waste.wsdl" destJwsDir="${src.dir}/webservices" destImplDir="${src.dir}/webservices" packageName="org.arc.eterws.generated" /> </target> <target name="webservices" description=""> <jwsc srcdir="${src.dir}/webservices" destdir="${dest.dir}" classpathref="wspath"> <module contextPath="E3S" name="webservices"> <jws file="org/arc/eterws/impl/IE3SEnvironmentalMasterDataImpl.java" compiledWsdl="${src.dir}/webservices/e3s-environmentalMasterData_wsdl.jar"/> <jws file="org/arc/eterws/impl/Ie3SWasteImpl.java" compiledWsdl="${src.dir}/webservices/e3s-waste_wsdl.jar"/> <descriptor file="${src.dir}/webservices/META-INF/web.xml"/> </module> </jwsc> </target> My questions are: How Weblogic "unmarshall" the xml with the JAX-RPC tech and can we do the same with a xsd element? How can we do this if yes? If not, Exists any not complex solution to this problem? If not, must we use XMLBean tech. or regenerate the XSD with JAXB tech.? What is the best solution? NOTE: There are not one single xsd but a complex xsd structure in fact.

    Read the article

  • Memory leak with JAXB

    - by Anurag
    Hi, I am getting Out of Memory error: Memory Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at org.apache.xerces.dom.CoreDocumentImpl.createElement(CoreDocumentImpl.java:564) I have a standalone Java program which fetches data from DB and create an XML file using DOM. I get the above error if the data fetched is huge, in my case it is 1,000,000 records. I have defined 2GB as heap size while calling the Java class from unix. I tried it with JAXB, but still do not any significant improvement. Any suggestions how to improve the code.

    Read the article

  • jaxb namespaces in each element instead of root element during marshalling

    - by Anton
    By default, jaxb 2 lists all (all possible required) namespaces in root element during marshalling: <rootElement xmlns="default_ns" xmlns:ns1="ns1" xmlns:ns2="ns2"> <ns1:element/> </rootElement> Is there a way to describe namespace in each element instead of root element ?: <rootElement xmlns="default_ns"> <element xmlns="ns1"/> </rootElement> It also solves the problem of "unnecessary namespaces", which is also important in my case. Any suggestions appreciated.

    Read the article

  • Explanation of JAXB error: Invalid byte 1 of 1-byte UTF-8 sequence

    - by Marcus
    We're parsing an XML document using JAXB and get this error: [org.xml.sax.SAXParseException: Invalid byte 1 of 1-byte UTF-8 sequence.] at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:315) What exactly does this mean and how can we resolve this?? We are executing the code as: jaxbContext = JAXBContext.newInstance(Results.class); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); unmarshaller.setSchema(getSchema()); results = (Results) unmarshaller.unmarshal(new FileInputStream(inputFile)); Update Issue appears to be due to this "funny" character in the XML file: ¿ Why would this cause such a problem??

    Read the article

  • XML strings in JAXB

    - by OOO
    I have a JPA entity class mimicking a table. Something like this: @XmlType(name="MyClassElementType") public class MyClass { String name; String xmlDesc; public MyClass() {} @XmlElement String getName() { return name; } void setName(String name) { this.name = name; } @XmlElement String getXmlDesc() { return xmlDesc; } void setXmlDesc(String xmlDesc) { this.xmlDesc = xmlDesc; } } In a Jersey REST get call I'm trying to return this class: @Get @Produces("application/xml") public MyClass get() { return myClass; } Now I'm expecting the already xml string(xmlStr) to be returned as is, but Jersey/JAXB escapes it... So anyway around this?

    Read the article

  • .NET JAXB equivalent?

    - by Dan
    Is there an equivalent library for JAXB in .NET? I am trying to convert an XML I get to a .NET class. I have the XSD, but not sure how to convert the XML received into a concrete Class? I used the XSD tool to generate a class from the schema, but what I want to to convert the XML I receive on the fly to a object that I can work with in code. I've seen the thread here that deals with this, but my query is - I want the object created to contain the data that I receive in the XML (i.e. the field values must be populated).

    Read the article

  • Customizing error handling of JAXB unmarshall process

    - by ekeren
    Assuming I have a schema that describes a root element class Root that contains a List<Entry> where the Entry class has a required field name. Here is how it looks in code: @XmlRootElement class Root{ @XmlElement(name="entry") public List<Entry> entries = Lists.newArrayList(); } @XmlRootElement class Entry{ @XmlElement(name="name",required=true) public String name; } If I supply the following XML for unmarshalling: <root> <entry> <name>ekeren</name> </entry> <entry> </entry> </root> I have a problem because the second entry does not contain a name. So unmarshall produces null. Is there a way to customize JAXB to unmarshall a Root object that will only contain the "good" entry?

    Read the article

  • jaxb unmarshal problem

    - by Hoax
    private JAXBContext jaxbContext; private Marshaller marshaller; private Unmarshaller unmarshaller; private PoiList db; public XMLHandler() { try { JAXBContext.newInstance("x.y.shared"); } catch (JAXBException e) { e.printStackTrace(); } } public PoiList readXML() { try { unmarshaller = jaxbContext.createUnmarshaller(); unmarshaller.setEventHandler(new XMLValidEventHandler()); db = (PoiList) unmarshaller.unmarshal(new File("src/source.xml")); } catch (JAXBException e) { e.printStackTrace(); } return db; } gets me this Exception in thread "main" java.lang.NullPointerException at com.sem.server.XMLHandler.readXML(XMLHandler.java:32) at sem.server.testDataAPI.main(testDataAPI.java:13) Line 32 in this case is the jaxbContext.createUnmarshaller() Line. packages are x.y.client x.y.server (includes the XMLHandler) x.y.shared (includes jaxb generated classes) not really sure what the problem is. any help is appreciated!

    Read the article

  • JAXB Customizations and List<Object>

    - by DaUltimateTrooper
    Hi everybody. I used JAXB to create some classes from an XSD. The result was not quite what I expected and most probably it can be customized. It created a generic list instead of 3 different lists. Can this be corrected somehow? @XmlElements({ @XmlElement(name = "M1", type = M1_Type.class), @XmlElement(name = "M2", type = M2_Type.class), @XmlElement(name = "M3", type = M3_Type.class) }) protected List<Object> m1Orm2OrM3; Is there a customization to fix this?

    Read the article

  • Java/JAXB: Unmarshall Xml to specific subclass based on an attribute

    - by Frothy
    Is it possible to use JAXB to unmarshall xml to a specific Java class based on an attribute of the xml? <shapes> <shape type="square" points="4" square-specific-attribute="foo" /> <shape type="triangle" points="3" triangle-specific-attribute="bar" /> </shapes> I would like to have a List of Shape objects containing a triangle and a square, each with their own shape-specific attribute. IE: abstract class Shape { int points; //...etc } class Square extends Shape { String square-specific-attribute; //...etc } class Triangle extends Shape { String triangle-specific-attribute; //...etc } I'm currently just putting all attributes in one big "Shape" class and it's less than ideal. I could get this to work if the shapes were properly named xml elements, but unfortunately I don't have control of the xml I'm retrieving. Thanks!

    Read the article

  • JAXB - How to add xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance

    - by Anurag
    I am using JAXB to create XML file from a result set. I have created java/ /class files using the xsd with the help of xjc utiliy. Now I am trying to create the xml file using the Marshaller. In the XML file I do not see theh xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attribute with the root tag. My xsd Below is the code : public class JAXBConstructor { public void generateXMLDocument(File xmlDocument){ try { JAXBContext jaxbContext = JAXBContext.newInstance("com"); Marshaller marshaller = jaxbContext.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); com.ObjectFactory factory = new com.ObjectFactory(); USERTASKSImpl userTasks =(USERTASKSImpl)(factory.createUSERTASKS()); USERTASKTypeImpl userTaskType = (USERTASKTypeImpl)(factory.createUSERTASKSTypeUSERTASKType()); userTaskType.setName("zmannan"); userTaskType.setCode("G5023920"); java.util.List userTaskList=userTasks.getUSERTASK(); userTaskList.add(userTaskType); marshaller.marshal(userTasks, new FileOutputStream("User_Task.xml")); } Output of the code : This does not contain the XMLSchema value - < ?xml version="1.0" encoding="UTF-8" standalone="yes"? < USER_TASKS xmlns="http://schemas.jpmchase.net/Recertification" < CodeG5023920< /Code < Namezmannan< /Name < /USER_TASK < /USER_TASKS Please help how can I add the schema-instance value in the rrot tag.

    Read the article

  • Enum "does not have a no-arg default constructor" with Jaxb and cxf

    - by Dave
    A client is having an issue running java2ws on some of their code, which uses & extends classes that are consumed from my SOAP web services. Confused yet? :) I'm exposing a SOAP web service (JBoss5, Java 6). Someone is consuming that web service with Axis1 and creating a jar out of it with the data types and client stubs. They are then defining their own type, which extends one of my types. My type contains an enumeration. class MyParent { private MyEnumType myEnum; // getters, settters for myEnum; } class TheirChild extends MyParent { ... } When they are running java2ws on their code (which extends my class), they get Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions net.foo.bar.MyEnuMType does not have a no-arg default constructor. this problem is related to the following location: at net.foo.bar.MyEnumType at public net.foo.bar.MyEnumType net.foo.bar.MyParent.getMyEnum() The enum I've defined is below. This is now how it comes out after being consumed, but it's how I have it defined on the app server: @XmlType(name = "MyEnumType") @XmlEnum public enum MyEnumType { Val1("Val1"), Val2("Val2") private final String value; MyEnumType(String v) { value = v; } public String value() { return value; } public static MyEnumType fromValue(String v) { if (v == null || v.length() == 0) { return null; } if (v.equals("Val1")) { return MyEnumType.Val1; } if (v.equals("Val2")) { return MyEnumType.Val2; } return null; } } I've seen things online and other posts, like (this one) regarding Jaxb's inability to handle Lists or things like that, but I'm baffled about my enum. I'm pretty sure you can't have a default constructor for an enum (well, at least a public no-arg constructor, Java yells at me when I try), so I'm not sure what makes this error possible. Any ideas? Also, the "2 counts of IllegalAnnotationsExceptions" may be because my code actually has two enums that are written similarly, but I left them out of this example for brevity.

    Read the article

  • Is it a jaxb bug?

    - by wd-shuang
    I take a scheme, its element definition as follows: <xs:complexType name="OriginalMessageContents1"> <xs:sequence> <xs:any namespace="##any" processContents="skip"/> <xs:any namespace="##any" processContents="skip" minOccurs="0"/> </xs:sequence> </xs:complexType> I use xjb to export java file,xjb as follow: <jxb:bindings version="2.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <jxb:bindings schemaLocation="ibps.706.001.01.xsd" node="/xs:schema"> <jxb:bindings node="//xs:complexType[@name='OriginalMessageContents1']/xs:sequence"> <jxb:bindings node=".//xs:any[position()=1]"> <jxb:property name="anyOne"/> </jxb:bindings> <jxb:bindings node=".//xs:any[position()=2]"> <jxb:property name="anyTwo"/> </jxb:bindings> </jxb:bindings> </jxb:bindings> </jxb:bindings> Java as: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "OriginalMessageContents1", propOrder = { "anyOne", "anyTwo" }) public class OriginalMessageContents1 { @XmlAnyElement protected Element anyOne; @XmlAnyElement protected Element anyTwo; public Element getAnyOne() { return anyOne; } public void setAnyOne(Element value) { this.anyOne = value; } public Element getAnyTwo() { return anyTwo; } public void setAnyTwo(Element value) { this.anyTwo = value; } } When I unmashaller this object by using getAnyOne,I get the contents of the second element. I got null by using getAnyTwo. It is a bug? Anybody can help me ?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >