Search Results

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

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

  • controlling the class names generated by JAXB for xsd:attributeGroup?

    - by Stephen Winnall
    I am using JAXB to bind XML to Java for an application that I am writing. I have an element called measure which contains two amount elements called amount and maxAmount, with which I want to model a lower and an upper limiting value. amount and maxAmount are otherwise identical and I would like them to be implemented with the same class when unmarshalled into Java. The following is an extract from the XML schema which I feed to JAXB: <xsd:attributeGroup name="AmountAttributes"> <xsd:attribute name="quantity" type="xsd:decimal"/> <xsd:attribute name="numerator" type="xsd:nonNegativeInteger"/> <xsd:attribute name="denominator" type="xsd:positiveInteger"/> </xsd:attributeGroup> <xsd:element name="measure"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="0" name="amount"> <xsd:complexType> <xsd:attributeGroup ref="mpr:AmountAttributes"/> </xsd:complexType> </xsd:element> <xsd:element minOccurs="0" name="maxAmount"> <xsd:complexType> <xsd:attributeGroup ref="mpr:AmountAttributes"/> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> JAXB creates from this a more elaborate version of the following: public class Measure { protected Measure.Amount amount; protected Measure.MaxAmount maxAmount; public static class Measure.Amount {} public static class Measure.MaxAmount {} } Measure.Amount and Measure.MaxAmount are identical except for their names, but - of course - as far as Java is concerned they have little to do with each other. Is there a way of making JAXB use the same class for both amount and maxAmount? Just to come completely clean ;-) I should mention that I generate the XML schema from RNC using Trang. If the answer to the question is "change the XML schema", I have the supplementary question "how do I change the RNC to produce that XML schema?". My RNC looks like this: AmountAttributes = QuantityAttribute? & attribute numerator { xsd:nonNegativeInteger }? & attribute denominator { xsd:positiveInteger }? QuantityAttribute = attribute quantity { xsd:decimal } Measure = element measure { element amount { AmountAttributes }?, element maxAmount { AmountAttributes }? }+ I use RNC because I find it simpler to understand, but if the solution to my problem means just using XML Schema, so be it. Steve

    Read the article

  • how can i unmarshall in jaxb and enjoy the schema validation without using an explicit schema file

    - by ekeren
    I am using jaxb for my application configurations I feel like I am doing something really crooked and I am looking for a way to not need an actual file or this transaction. As you can see in code I: 1.create a schema into a file from my JaxbContext (from my class annotation actually) 2.set this schema file in order to allow true validation when I unmarshal JAXBContext context = JAXBContext.newInstance(clazz); Schema mySchema = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(schemaFile); jaxbContext.generateSchema(new MySchemaOutputResolver()); // ultimately creates schemaFile Unmarshaller u = m_context.createUnmarshaller(); u.setSchema(mySchema); u.unmarshal(...); do any of you know how I can validate jaxb without needing to create a schema file that sits in my computer? Do I need to create a schema for validation, it looks redundant when I get it by JaxbContect.generateSchema ? How do you do this?

    Read the article

  • How do I prevent JAXB from generating Java from imported schema?

    - by Mark
    I've got two Java projects, both generate Java classes based on a schema definition, I'm using xjc to create the classes. My second project depends on a class from the first project, and in particular, one of the classes I'd like to generate in my second project needs to use one of the types from the first project. To accomplish this dependency at the schema level, I'm using a simple xsd:import to map the namespace to a particular schema. JAXB works just fine with this condition, except it also generates the first project's types in the second project. So after running have something like this: Project A +-- com.foo.bar +-- TypeA Project B +-- com.foo.asdf +-- TypeB +-- com.foo.bar +-- TypeA The second "TypeA" is undesirable, and I'd like to never generate it in the first place. How do I instruct JAXB not to generate the classes for "TypeA" that it finds as a result of the import statement?

    Read the article

  • Why does "xsd:date" of XML Schema Type mapped "javax.xml.datatype.XMLGregorianCalendar" When Schema-to-Java Mapping of JAXB does.

    - by Take
    I don't know why does "xsd:date" of XML Schema Type mapped "javax.xml.datatype.XMLGregorianCalendar" When Schema-to-Java Mapping of JAXB does. Why does "xsd:date" of XML Schema Type mapped "java.util.Date" ? I guess that JAXB intentionally does its mapping. I want to know that reason if any. And if exists it, how to change "xsd:date" of XML Schema Type to "java.util.Date" of Java class without using annotation(ex.@XmlJavaTypeAdapter). I want to do mashalling and unmarshalling without all annotations.

    Read the article

  • How to add DOCTYPE and xml processing instructions when marshalling with JAXB?

    - by Juha Syrjälä
    I am marshalling (serializing) JAXB beans to output stream. How can I add DOCTYPE declaration and xml processing instructions to ouput? I am doing currently marshalling like this: JAXBContext jaxbContext = JAXBContext.newInstance("com.example.package"); Marshaller marshaller = jaxbContext.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); Schema schema = schemaFactory.newSchema(schemaSource); marshaller.setSchema(schema); marshaller.marshal(object, output); I'd like have output that looks something like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Something SYSTEM "some.dtd"> <?xml-stylesheet type="text/xsl" href="some.xsl"?> JAXB bean are generated code so I don't want to change them. There are some undocumented tricks to add the xml processing instructions and doctype. But what is the preferred or right way to do this?

    Read the article

  • Can I force JAXB not to convert " into &quot;, for example, when marshalling to XML?

    - by Elliot
    I have an Object that is being marshalled to XML using JAXB. One element contains a String that includes quotes ("). The resulting XML has &quot; where the " existed. Even though this is normally preferred, I need my output to match a legacy system. How do I force JAXB to NOT convert the HTML entities? -- Thank you for the replies. However, I never see the handler escape() called. Can you take a look and see what I'm doing wrong? Thanks! package org.dc.model; import java.io.IOException; import java.io.Writer; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import org.dc.generated.Shiporder; import com.sun.xml.internal.bind.marshaller.CharacterEscapeHandler; public class PleaseWork { public void prettyPlease() throws JAXBException { Shiporder shipOrder = new Shiporder(); shipOrder.setOrderid("Order's ID"); shipOrder.setOrderperson("The woman said, \"How ya doin & stuff?\""); JAXBContext context = JAXBContext.newInstance("org.dc.generated"); Marshaller marshaller = context.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); marshaller.setProperty(CharacterEscapeHandler.class.getName(), new CharacterEscapeHandler() { @Override public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException { out.write("Called escape for characters = " + ch.toString()); } }); marshaller.marshal(shipOrder, System.out); } public static void main(String[] args) throws Exception { new PleaseWork().prettyPlease(); } } -- The output is this: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <shiporder orderid="Order's ID"> <orderperson>The woman said, &quot;How ya doin &amp; stuff?&quot;</orderperson> </shiporder> and as you can see, the callback is never displayed. (Once I get the callback being called, I'll worry about having it actually do what I want.) --

    Read the article

  • how to generate JMX MXBean compatible java class model from JAXB?

    - by yucubby
    From the JMX MXBean specification, a java class type J must satisfy Either if J has at least one public constructor with a ConstructorProperties annotation, Or if J has a public no-arg constructor, and for every getter in J with type T and name N there is a corresponding setter with the same name and type So how can I use JAXB to generate JAVA class model which satisfy the MXBean constrain? Thanks YU

    Read the article

  • How do I add a namespace attribute to an element in JAXB when marshalling?

    - by Ryan Elkins
    I'm working with eBay's LMS (Large Merchant Services) and kept running into the error: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. After alot of trial and error I traced the problem down. It turns out this works: <?xml version="1.0" encoding="UTF-8"?> <BulkDataExchangeRequests xmlns="urn:ebay:apis:eBLBaseComponents"> <Header> <Version>583</Version> <SiteID>0</SiteID> </Header> <AddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents"> while this (what I've been sending) doesn't: <?xml version="1.0" encoding="UTF-8"?> <BulkDataExchangeRequests xmlns="urn:ebay:apis:eBLBaseComponents"> <Header> <Version>583</Version> <SiteID>0</SiteID> </Header> <AddFixedPriceItemRequest> The difference is the xml namespace attribute on the AddFixedPriceItemRequest . All of my XML is currently being marshalled via JAXB and I'm not sure what is the best way to go about adding a second xmlns attribute to a different element in my file. So that's the question. How do I add an xmlns attribute to another element in JAXB? UPDATE: package ebay.apis.eblbasecomponents; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AddFixedPriceItemRequestType", propOrder = { "item" }) public class AddFixedPriceItemRequestType extends AbstractRequestType { @XmlElement(name = "Item") protected ItemType item; public ItemType getItem() { return item; } public void setItem(ItemType value) { this.item = value; } } Added class definition by request. UPDATE 2: Edited the above class like so to no effect: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(namespace = "urn:ebay:apis:eBLBaseComponents", name = "AddFixedPriceItemRequestType", propOrder = { "item" }) public class AddFixedPriceItemRequestType UPDATE 3: Here is a snippet of the BulkDataExchangeRequestsType class. I tried throwing a namespace="urn:ebay:apis:eBLBaseComponents" into the @XmlElement for AddFixedPriceItemRequest but it didn't do anything. @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "BulkDataExchangeRequestsType", propOrder = { "header", "addFixedPriceItemRequest" }) public class BulkDataExchangeRequestsType { @XmlElement(name = "Header") protected MerchantDataRequestHeaderType header; @XmlElement(name = "AddFixedPriceItemRequest") protected List<AddFixedPriceItemRequestType> addFixedPriceItemRequest; UPDATE 4: Here's the hideous chunk of code that is updating the xml after marshalling for me. This is currently working although I'm not particulary proud of it. DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.newDocument(); marshaller.marshal(request, doc); NodeList nodes = doc.getChildNodes(); nodes = nodes.item(0).getChildNodes(); for(int i = 0; i < nodes.getLength(); i++){ Node node = nodes.item(i); if (!node.getNodeName().equals("Header")){ ((Element)node).setAttribute("xmlns", "urn:ebay:apis:eBLBaseComponents"); } } Update 5: For anyone else that runs into this problem with eBay and wonders why - The reasoning behind this most likely has to do with how eBay is handling these requests. The BulkDataExchange probably takes the XML payload, breaks it up, and send the pieces out to the Merchant or Trading API. The inner pieces of the payload then do not have the namespace and the get the error. This is a guess on my part but I wouldn't be surprised if this is what was going on behind the scenes. Thanks for all the help everyone.

    Read the article

  • How to use JAXB APIs to generate classes from xsd?

    - by Simran
    I need to generate bean classes from .xsd without using xjc command or ant. i have found the implementation in Apache Axis2 but i am unable to generate the artifacts. i have written the following code but i get NullPointerException : SchemaCompiler sc = XJC.createSchemaCompiler(); URL url = new URL("file://E:\\JAXB\\books.xsd"); sc.parseSchema(new InputSource(url.toExternalForm())); S2JJAXBModel model = sc.bind(); JCodeModel cm = model.generateCode(null, null); cm.build(new FileCodeWriter(new File("E:\\JAXBTest"))); Can anyone help me / provide some links???

    Read the article

  • Interview with Java Champion Matjaz B. Juric on Cloud Computing, SOA, and Java EE 6

    - by [email protected]
    In a Java Champion interview Matjaz Juric of Slovenia, head of the Cloud Computing and SOA Competence Centre at the University of Maribor, and professor at the University of Ljubljana, shares insights about cloud computing, SOA and Java EE 6. Juric has worked on performance analysis and optimization of RMI-IIOP, as well as being a member of the BPEL Advisory Board, and a Java mentor and trainer.Regarding BPEL he remarks, "Probably the most important thing to understand is what should be programmed in Java and what should be programmed in BPEL. There is still some confusion. BPEL is for the process logic, while Java is for functionalities. Together, BPEL and Java form a strong alliance and enable faster development and maintenance of enterprise applications and their integrations. On the other hand, the integration between Java and BPEL could be improved. There have been different approaches, including Java snippets. I would like to see an XML data type in Java, without all the hassles with JAXB, mappings, or DOM." Read the rest of the article here.

    Read the article

  • Java XML Unmarshalling fails on ampersand (&amp;) using JAXB

    - by ryanprayogo
    I have the following XML: <?xml version="1.0" encoding="UTF-8"?> <details> ... <address1>Test&amp;Address</address1> ... </details> When I try to unmarshal it using JAXB, it throws the following exception: Caused by: org.xml.sax.SAXParseException: The reference to entity "Address" must end with the ';' delimiter. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:194) But when I changed the &amp; in the XML to &apos;, it works. Looks like the problem is only with ampersand &amp; and I cannot understand why. The code to unmarshal is: JAXBContext context = JAXBContext.newInstance("some.package.name", this.getClass().getClassLoader()); Unmarshaller unmarshaller = context.createUnmarshaller(); obj = unmarshaller.unmarshal(new StringReader(xml)); Anyone have some insight?

    Read the article

  • How do you marshall a parameterized type with JAX-WS / JAXB?

    - by LES2
    Consider the following classes (please assume public getter and setter methods for the private fields). // contains a bunch of properties public abstract class Person { private String name; } // adds some properties specific to teachers public class Teacher extends Person { private int salary; } // adds some properties specific to students public class Student extends Person { private String course; } // adds some properties that apply to an entire group of people public class Result<T extends Person> { private List<T> group; private String city; // ... } We might have the following web service implementation annotated as follows: @WebService public class PersonService { @WebMethod public Result<Teacher> getTeachers() { ... } @WebMethod public Result<Student> getStudents() { ... } } The problem is that JAXB appears to marshall the Result object as a Result<Person> instead of the concrete type. So the Result returned by getTeachers() is serialized as containing a List<Person> instead of List<Teacher>, and the same for getStudents(), mutatis mutandis. Is this the expected behavior? Do I need to use @XmlSeeAlso on Person? Thanks! LES

    Read the article

  • How do I add array indices to the XML produced by JAXB?

    - by oconnor0
    I have a Java bean ala @XmlRootElement public class Bean { @XmlElementWrapper(name = "ints") @XmlElement(name = "int") int[] values; // constructors, getters, setters, etc... } JAXB is producing XML like <bean> <ints> <int>12</int> <int>34</int> <int>56</int> </ints> </bean> I would like the array indices to be included on the <int> tags as array position conveys important value. Preferably as attributes like <bean> <ints> <int id='0'>12</int> <int id='1'>34</int> <int id='2'>56</int> </ints> </bean> Is there a way to do this?

    Read the article

  • jax-ws: how to get a handle to start/end of processing incoming soap message

    - by Gerard
    Situation: jax-ws web service on Weblogic appserver; wsdl first development, jaxb customizations in external binding file. I would like to get a handle to the actual jaxb context that will process the incoming soap xml message, before it has been unmarshalled into java objects. Then I would like to get the unmarshaller of this jaxb context - the one that actually will be used during the unmarshalling. And then setup some properties of this unmarshaller (e.g. listener and idresolver).

    Read the article

  • How do I prevent JAXB from binding superclass methods of the @XmlRootElement when marshalling?

    - by Matt Fisher
    I have a class that is annotated as the @XmlRootElement with @XmlAccessorType(XmlAccessType.NONE). The problem that I am having is that the superclass's methods are being bound, when I do not want them to be bound, and cannot update the class. I am hoping there is an annotation that I can put on the root element class to prevent this from happening. Example: @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) public class Person extends NamedObject { @XmlElement public String getId() { ... } } I would expect that only the methods annotated @XmlElement on Person would be bound and marshalled, but the superclass's methods are all being bound, as well. The resulting XML then has too much information. How do I prevent the superclass's methods from being bound without having to annotate the superclass, itself?

    Read the article

  • How can i tell jaxb / Maven to genereate multiple schema packages?

    - by M.R.
    Example: </plugin> <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.7.1</version> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <schemaDirectory>src/main/resources/dir1</schemaDirectory> <schemaIncludes> <include>schema1.xsd</include> </schemaIncludes> <generatePackage>schema1.package</generatePackage> </configuration> </plugin> <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.7.1</version> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <schemaDirectory>src/main/resources/dir2</schemaDirectory> <schemaIncludes> <include>schema2.xsd</include> </schemaIncludes> <generatePackage>schema2.package</generatePackage> </configuration> </plugin> </plugins> What happened: Maven executes the the first plugin. Then deletes the target folder and creates the second package, which then is visible. I tried to set target/somedir1 for the first configuration and target/somedir2 for the second configuration. But the behavior does not not change? Any ideas? I do not want to generate the packages directly in the src/main/java folder, because these packages are genereated and should not be mixed with manual created classes.

    Read the article

  • Is it possible the generate shared objects using JAXB?

    - by Peter Szanto
    I have 3 xsd files: a.xsd b.xsd shared.xsd shared.xsd is imported to both a.xsd and b.xsd using <xs:import schemaLocation="shared.xsd"/> shared.xsd defines <xs:element name="item"> <xs:complexType> .... If I generate java code using xjc a.xsd and b.xsd is generated into different packages and in each package a separate java class is generated for item. How would it be possible to have a single shared class for item and make a and b use it?

    Read the article

  • Why does JAXB not create a member variable in its generated code when an XML schema base type and subtype have the same element declared in them?

    - by belltower
    I have a question regarding with regard to JAXB generated classes. As you can I see, I have a complex type, DG_PaymentIdentification1, declared in my schema. Its a restriction of PaymentIdentification1. DG_PaymentIdentification1 is also identical to PaymentIdentification1. I also have a type called DG_CreditTransferTransactionInformation10 which has a base type of CreditTransferTransactionInformation10 and is identical to it. I have included the relevant XML schema snippets below. <xs:complexType name="DG_PaymentIdentification1"> <xs:complexContent> <xs:restriction base="PaymentIdentification1"> <xs:sequence> <xs:element name="InstrId" type="DG_Max35Text_REF" minOccurs="0"/> <xs:element name="EndToEndId" type="DG_Max35Text_REF" id="DG-41"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="PaymentIdentification1"> <xs:sequence> <xs:element name="InstrId" type="Max35Text" minOccurs="0"/> <xs:element name="EndToEndId" type="Max35Text"/> </xs:sequence> </xs:complexType> <xs:complexType name="DG_CreditTransferTransactionInformation10"> <xs:complexContent> <xs:restriction base="CreditTransferTransactionInformation10"> <xs:sequence> <xs:element name="PmtId" type="DG_PaymentIdentification1"/> <xs:simpleType name="DG_Max35Text_REF"> <xs:restriction base="DG_NotEmpty35"> <xs:pattern value="[\-A-Za-z0-9\+/\?:\(\)\.,'&#x20;]*"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="Max35Text"> <xs:restriction base="xs:string"> <xs:minLength value="1"/> <xs:maxLength value="35"/> </xs:restriction> </xs:simpleType> JAXB generates the following java class for DG_PaymentIdentification1: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DG_CreditTransferTransactionInformDGion10") public class DGCreditTransferTransactionInformation10 extends CreditTransferTransactionInformation10 { } My question is why doesnt the DGCreditTransferTransactionInformation10 generated class have a variable of type DG_PaymentIdentification1 in the generated code? The base class CreditTransferTransactionInformation10 does have a type PaymentIdentification1 declared in it. Is there any way of ensuring that DGCreditTransferTransactionInformation10 will have a DG_PaymentIdentification1 in it?

    Read the article

  • Is it possible to handle User Defined Exception using JAX WS Dispatch API ?

    - by snowflake
    Hello, I'm performing dynamic webservices call using following code snippet: JAXBContext jc = getJAXBContext(requestClass, responseClass, jaxbContextExtraClasses); Dispatch<Object> dispatch = service.createDispatch(portQName, jc, Service.Mode.PAYLOAD); Object requestValue = getRequestValue(requestClass, pOrderedParameters); JAXBElement<?> request = new JAXBElement(new QName(serviceQNameStr, pOperationName), requestValue.getClass(), null, requestValue); Object tmpResponse = dispatch.invoke(request); Invocation works perfectly, except if I add a user defined exception on the service (a basic UserException extends java.lang.Exception). First I get: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://schemas.xmlsoap.org/soap/envelope/", local:"Fault"). Expected elements are <{http://my.namespace/}myMethod,<{http://my.namespace/}myResponse Then I added the UserException_Exception JAX-WS generated type to my JAXB Context, and then get: Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions java.lang.StackTraceElement does not have a no-arg default constructor. this problem is related to the following location: at java.lang.StackTraceElement at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace() at java.lang.Throwable at java.lang.Exception Only solution available I found are: dispatch directly a Soap message and handle Soap fault directly (this is the way Jboss JAX-WS implementation performs a standard JAX-WS call using services interfaces). This is not an available solution for me, I want to use a high level implementation (the more I get close to Soap message the less dynamic my code can be) usage of JAXBRIContext.ANNOTATION_READER, which is implementation specific and not an available solution for me, in order to annotate annotates java.lang.Exception as @XmlTransient The service with a user defined exception performs well using the JAX-WS generated standard client stubs and using a tool such Soap UI. Problem occurs in deserialization of the message when I have no user defined exception artifact in the JAXB context, and during invocation when I add those non JAXB compatible artifacts in the JAXB context. I'm usign Jboss WS webservice stack within Jboss 4.2.3.GA Any elegant solution to this problem is welcomed !

    Read the article

  • DocuSign Connect xsd [on hold]

    - by Brian
    I'm trying to parse xml inbound to our system from the DocuSign Connect service (which publishes status updates to a given web service). I typiclly use jaxb to process xml but as far as I know I need xsd's in order to generate the jaxb. I don't have (or can't find) xsd's from DocuSign in order to do this. I could use other java classes/libraries to parse the xml but without xsd's I'd have to guess at types, restrictions and formats. Is there a way to generate jaxb without having xsd's?

    Read the article

  • Applying a patch from java.net

    - by user354414
    I have a problem with Jaxb enumerations that is related to this bug https://jaxb.dev.java.net/issues/show_bug.cgi?id=708 A patch has been supplied to the issue that can resolve the problem. How can I apply this patch to resolve my problem

    Read the article

  • SpringBatch Jaxb2Marshaller: different name of class and xml attribute

    - by user588961
    I try to read an xml file as input for spring batch: Java Class: package de.example.schema.processes.standardprocess; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Process", namespace = "http://schema.example.de/processes/process", propOrder = { "input" }) public class Process implements Serializable { @XmlElement(namespace = "http://schema.example.de/processes/process") protected ProcessInput input; public ProcessInput getInput() { return input; } public void setInput(ProcessInput value) { this.input = value; } } SpringBatch dev-job.xml: <bean id="exampleReader" class="org.springframework.batch.item.xml.StaxEventItemReader" scope="step"> <property name="fragmentRootElementName" value="input" /> <property name="resource" value="file:#{jobParameters['dateiname']}" /> <property name="unmarshaller" ref="jaxb2Marshaller" /> </bean> <bean id="jaxb2Marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> <property name="classesToBeBound"> <list> <value>de.example.schema.processes.standardprocess.Process</value> <value>de.example.schema.processes.standardprocess.ProcessInput</value> ... </list> </property> </bean> Input file: <?xml version="1.0" encoding="UTF-8"?> <process:process xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:process="http://schema.example.de/processes/process"> <process:input> ... </process:input> </process:process> It fires the following exception: [javax.xml.bind.UnmarshalException: unexpected element (uri:"http://schema.example.de/processes/process", local:"input"). Expected elements are <<{http://schema.example.de/processes/process}processInput] at org.springframework.oxm.jaxb.JaxbUtils.convertJaxbException(JaxbUtils.java:92) at org.springframework.oxm.jaxb.AbstractJaxbMarshaller.convertJaxbException(AbstractJaxbMarshaller.java:143) at org.springframework.oxm.jaxb.Jaxb2Marshaller.unmarshal(Jaxb2Marshaller.java:428) If I change to in xml it work's fine. Unfortunately I can change neither the xml nor the java class. Is there a possibility to make Jaxb2Marshaller map the element 'input' to the class 'ProcessInput'?

    Read the article

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