Search Results

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

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

  • Jaxb to generate the XML directly to the OutputStream

    - by sonu
    Hi, I have a 500Mb csv file. I need to convert it into XML file. I am using the Jaxb to created the xml file. It is working fine for small amout of data. but for large amout of data like 300 mb it is throwing out of memory exception. Can anyone tell me that How can I create each element and write it into a file without creating the whole tree using the jaxb?" Thanks Sonu

    Read the article

  • post xml to Spring REST server returns Unsupported Media Type

    - by Mayra
    I'm trying to create a simple spring based webservice that supports a "post" with xml content. In spring, I define an AnnotationMethodHandler: <bean id="inboundMessageAdapter" class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> <property name="messageConverters"> <util:list> <bean class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter"> <property name="marshaller" ref="xmlMarshaller"/> <property name="unmarshaller" ref="xmlMarshaller"/> </bean> </util:list> </property> </bean> And a jaxb based xml marshaller: <bean id="xmlMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> <property name="contextPaths"> <array> <value>com.company.schema</value> </array> </property> <property name="schemas"> <array> <value>classpath:core.xsd</value> </array> </property> </bean> My controller is annotated as follows, where "Resource" is a class autogenerated by jaxb: @RequestMapping(method = POST, value = "/resource") public Resource createResource(@RequestBody Resource resource) { // do work } The result of a webservice call is always "HTTP/1.1 415 Unsupported Media Type". Here is an example service call: HttpPost post = new HttpPost(uri); post.addHeader("Accept", "application/xml"); post.addHeader("Content-Type", "application/xml"); StringEntity entity = new StringEntity(request, "UTF-8"); entity.setContentType("application/xml"); post.setEntity(entity); It seems to me that I am setting the correct media type everywhere possible. Anyone have an ideas?

    Read the article

  • Running custom JAXB2 plugins using Maven JAXB 2.x Plugin

    - by nadouani
    I would like to generate JAXB Java classes using the Maven JAXB 2.x plugin http://static.highsource.org/mjiip/maven-jaxb2-plugin/generate-mojo.html To declare the custom JAXB plugins I would execute during the generate process, I used the "args" element like below: <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.7.4</version> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <extension>true</extension> <args> <arg>-Xinheritance</arg> <arg>-XtoString</arg> </args> ... </configuration> ... </plugin> The issue is that the maven generate process is failing with the following error: Failed to execute goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.7.4:generate (default) on project was: Error parsing the command line [[Ljava.lang.String;@1ad4a1ae] Any idea on how to specify the args values? Thanks

    Read the article

  • Request/Response objects

    - by Dan
    I'm planning on using CXF's rest implementation. I'm thinking of simply annotating my entity classes with jaxb annotations, such as @XmlRootElement, in order to create response objects. The benefit being avoidance of code duplication. As for the (client) request object, which will be used by a separate web app, I'm thinking of 'copying' the entity classes, removing the orm annotations, and adding jaxb annotations. Based on the above: Are there any dangers of creating request/response objects from entity classes? My entity classes contain relational properties, if I were to annotate them with @XmlRootElement, how can I stop the relational properties from being added (or considered apart of) to the response object? Is there a better/easier way to create request objects rather than copying the entity classes, removing/adding annotations?

    Read the article

  • Make JAXWS-based webservice implement interface and unmarshall to known POJOs

    - by John K
    Given a Java SE 6 client, I would like to provide a configurable back-end: either directly to a database or through a web service which connects to a centralized DB. To that end, I've created some JPA- and JAXB-annotated entity classes and a DAO interface in a POJO library like the following: public interface MyDaoInterface { public MyEntity doSomething(); } @javax.persistence.Entity @javax.xml.bind.annotation.XmlRootElement public class MyEntity { private int a; .... } Now, I would like to have my auto-generated web service stubs implement that interface and interact with my defined entity classes, rather than the generated classes provided via the JAX-B unmarshaller. So, the client-side pseudo code would be something like MyDaoInterface dao; if (usingWebservice) dao = new WebserviceDao(); else dao = new JpaDao(); MyEntity e = dao.doSomething(); Is this possible with JPA, JAXB, JAXWS? Is this even advisable? Currently we achieve this through a slow manual process of massaging code, copying generating classes, and doing other things that seem just plain wrong to me.

    Read the article

  • Java object graph -> xml when direction of object association needs to be reversed.

    - by Sigmoidal
    An application I have been working on has objects with a relationship similar to below. In the real application both objects are JPA entities. class Underlying{} class Thing { private Underlying underlying; public Underlying getUnderlying() { return underlying; } public void setUnderlying(final Underlying underlying) { this.underlying = underlying; } } There is a requirement in the application to create xml of the form: <template> <underlying> <thing/> <thing/> <thing/> </underlying> </template> So we have a situation where the object graph expresses the relationship between Thing and Underlying in the opposite direction to how it's expressed in the xml. I expect to use JAXB to create the xml but ideally I don't want to have to create a new object hierarchy to reflect the associations in the xml. Is there any way to create xml of the form required from the entities in their current form (through the use of xml annotations or something)? I don't have any experience using JAXB but from the limited research I've done it doesn't seem like it's possible to reverse the direction of association in any straightforward way. Any help/advice would be greatly appreciated. One other option that has been suggested is to use XLST to transform the xml into the correct format. I have done no research on this topic as yet but I'll add to the question when I have some more info. Thanks, Matt.

    Read the article

  • Marshalling polymorphic objects in JAX-WS

    - by pkchukiss
    I'm creating a JAX-WS type webservice, with operations that return an object WebServiceReply. The class WebServiceReply itself contains a field of type Object. The individual operations would populate that field with a few different data-types, depending on the operation. Publishing the WSDL (I'm using Netbeans 6.7), and getting a ASP.NET application to retrieve and parse the WSDL was fine, but when I tried to call an operation, I would receive the following exception: javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException - with linked exception: [javax.xml.bind.JAXBException: class [LDataObject.Patient; nor any of its super class is known to this context.] How do I mark the annotations in the DataObject.Patient class, as well as the WebServiceReply class to get it to work? I haven't been able to fine a definitive resource on marshalling based upon annotations within the target classes either, so it would be great if anybody could point me to that too. WebServiceReply.java @XmlRootElement(name="WebServiceReply") public class WebServiceReply { private Object returnedObject; private String returnedType; private String message; private String errorMessage; .......... // Getters and setters follow } DataObject.Patient.java @XmlRootElement(name="Patient") public class Patient { private int uid; private Date versionDateTime; private String name; private String identityNumber; private List<Address> addressList; private List<ContactNumber> contactNumberList; private List<Appointment> appointmentList; private List<Case> caseList; } Solution (Thanks to Gregory Mostizky for his answer) I edited the WebServiceReply class so that all the possible return objects extend from a new class ReturnValueBase, and added the annotations using @XmlSeeAlso to ReturnValueBase. JAXB worked properly after that! Nonetheless, I'm still learning about JAXB marshalling in JAX-WS, so it would be great if anyone can still post any tutorial on this. Gregory: you might want to add-on to your answer that the return objects need to sub-class from ReturnValueBase. Thanks a lot for your help! I had been going bonkers over this problem for so long!

    Read the article

  • Convert XML to Java DTO and back in GWT

    - by RB
    Looking for best approach to convert Java DTO to XML and back while using GWT. I saw GWT has XMLParser in its client package which is a DOM Parser. I'm looking for more like a JAXB kind of plugin feature that I can use with GWT.

    Read the article

  • Java marshaller performance

    - by cbz
    Hi, I've used JAXB Marshaller as well as my own marshaller for marshalling pure java bean objects into XML. It has been observed that both of them require almost same time to marshal. The performance is not acceptable and needs to be improved. What are possible ways where we can improve performance of marshaller? Like threading?

    Read the article

  • how to remove empty tags in input xml

    - by SGB
    My java module gets a huge input xml from a mainframe. Unfortunately, the mainframe is unable to skip optional elements when it is not a leaf node, with the result that I get a LOT of empty tags in my input : So, <pre><code><SSN>111111111</SSN> <Employment> <Current> <Address> <line1/> <line2/> <line3/> <city/> <state/> <country/> </Address> <Phone> <phonenumber/> <countryCode/> </Phone> </Current> <Previous> <Address> <line1/> <line2/> <line3/> <city/> <state/> <country/> </Address> <Phone> <phonenumber/> <countryCode/> </Phone> </Previous> </Employment> <MaritalStatus>Single</MaritalStatus> </code></pre> should be <SSN>111111111</SSN> <MaritalStatus>Single</MaritalStatus> I use jaxb to unmarshall the input xml string that the mainframe sends it. Is there a clean/ easy way to remove all the empty group tags, or do I have to do this manuall in the code for each element. I have over 35 elements in my input xml, so I would love to it if jaxb itself had a way of doing this automatically? Thanks, SGB

    Read the article

  • How to use jaxb_commons plugins from maven

    - by user243155
    I'm trying to use a jaxb plugin to insert a interface into a choice element generating the classes from maven. The problem is that I can't seem to figure out how to do so from maven, the repository isn't clear from the documentation and the only example (bellow) doesn't work, it seems to ignore the plugin (maven reports no error about not finding it) or the plugin doesn't have all the adds-ons currently listed in the project documentation: <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.6.1</version> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <generatePackage>br.com.wonder.nfe.xml</generatePackage> <args> <arg>-Xifins</arg> </args> <plugins> <plugin> <groupId>org.jvnet.jaxb2_commons</groupId> <artifactId>basic</artifactId> <version>0.4.1.5</version> </plugin> </plugins> </configuration> </plugin> I have these in the root pom: <pluginRepositories> <pluginRepository> <id>maven2-repository.dev.java.net</id> <url>http://download.java.net/maven/2</url> </pluginRepository> <pluginRepository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven 1 Repository (legacy)</name> <url>http://download.java.net/maven/1</url> <layout>legacy</layout> </pluginRepository> </pluginRepositories> Running that gives: Error while setting CmdLine options '[-Xifins, -episode, /home/administrador/JavaApp/wnfe3/wnfe-ejb/target/generated-sources/xjc/META-INF/sun-jaxb.episode]'! Embedded error: unrecognized parameter -Xifins

    Read the article

  • XSD Client in Spring

    - by wuntee
    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.

    Read the article

  • JAX-WS MarshalException with custom JAX-B bindings: Unable to marshal type "java.lang.String" as an

    - by MoneyMark
    I seem to be having an issue with Jax-WS and Jax-b playing nicely together. I need to consume a web-service, which has a predefined WSDL. When executing the generated client I am receiving the following error: javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException - with linked exception: [com.sun.istack.SAXException2: unable to marshal type "java.lang.String" as an element because it is missing an @XmlRootElement annotation] This started occurring when I used an external custom binding file to map needlessly complex types to java.lang.string. Here is an excerpt from my binding file: <?xml version="1.0" encoding="UTF-8"?> <bindings xmlns="http://java.sun.com/xml/ns/jaxb" version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"> <bindings schemaLocation="http://localhost:7777/GESOR/services/RegistryUpdatePort?wsdl#types?schema1" node="/xs:schema"> <bindings node="//xs:element[@name='StwrdCompany']//xs:complexType//xs:sequence//xs:element[@name='company_name']"> <property> <baseType name="java.lang.String" /> </property> </bindings> <bindings node="//xs:element[@name='StwrdCompany']//xs:complexType//xs:sequence//xs:element[@name='address1']"> <property> <baseType name="java.lang.String" /> </property> </bindings> <bindings node="//xs:element[@name='StwrdCompany']//xs:complexType//xs:sequence//xs:element[@name='address2']"> <property> <baseType name="java.lang.String" /> </property> </bindings> ...more fields </bindings> </bindings> When executing wsimport against the provided WSDL, StwrdCompany is generated with the following variables declared: @XmlRootElement(name = "StwrdCompany") public class StwrdCompany { @XmlElementRef(name = "company_name", type = JAXBElement.class) protected String companyName; @XmlElementRef(name = "address1", type = JAXBElement.class) protected String address1; @XmlElementRef(name = "address2", type = JAXBElement.class) ... more fields ... getters/setters @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "value" }) public static class CompanyName { @XmlValue protected String value; @XmlAttribute protected Boolean updateToNULL; /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setValue(String value) { this.value = value; } /** * Gets the value of the updateToNULL property. * * @return * possible object is * {@link Boolean } * */ public boolean isUpdateToNULL() { if (updateToNULL == null) { return false; } else { return updateToNULL; } } /** * Sets the value of the updateToNULL property. * * @param value * allowed object is * {@link Boolean } * */ public void setUpdateToNULL(Boolean value) { this.updateToNULL = value; } ... more inner classes } } Finally, here is the associated snippet from the WSDL that seems to be causing such grief. <xs:element name="StwrdCompany"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="1" minOccurs="0" name="company_name" nillable="true"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute default="false" name="updateToNULL" type="xs:boolean"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element maxOccurs="1" minOccurs="0" name="address1" nillable="true"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute default="false" name="updateToNULL" type="xs:boolean"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> ... more fields in the same format <xs:element maxOccurs="1" minOccurs="0" name="p_source_timestamp" nillable="false" type="xs:string"/> </xs:sequence> <xs:attribute name="company_xid" type="xs:string"/> </xs:complexType> </xs:element> The reason for the custom binding is so I can map user input from a pojo into the StwrdCompany object more easily, whether it be direct instantiation or through the use of Dozer for bean mapping. I was unable to successfully map between the objects without the custom binding. Finally, one other thing I tried was setting a globalBinding definition: <globalBindings generateValueClass="false"></globalBindings> This caused the server to through an argument mismatch exception since the Soap Message was using xs:string xml types instead of passing the defined complex types, so I abandoned that idea. Any insight into what is causing the MarshalException or how to go about solving the issue of calling the webservice and mapping these objects more easily, is greatly appreciated. I've been searching for days and I sadly think I am stumped.

    Read the article

  • HyperJAXB and IDREFs

    - by finrod
    I have eventually managed to fiddle HyperJAXB so that when XSD has complexType A and this has an IDREF to complexType B, then HyperJAXB will generate @OneToOne JPA annotations between the the two generated entities. However now I'm facing another problem: the XSD has complex type X that can IDREF to either complex type Y or complex type Z. In the end, I need instance of complex type X contain reference to either instance of class Y or class Z. Do you have any wild ideas how can this be done without manual alterations to the generated classes? And at the same time to make sure these entities are marshalled to a correct XML? How about using the JAXB plugin that allows generating classes so that they implement a particular interface? Could that lead anywhere?

    Read the article

  • Is it required to generate java classes to use spring-ws client

    - by vishnu
    Hi, I want to use spring ws to create the webservice client. I have seen some documentation. In all using jaxb marshalling and unmarshalling. But to start of need to create java classes from xsd. I tried to download the elcipse plugin for this. The location in java.net is not showing any thing to download. Sourceforce net showing the link to download. But that plugin is not working. I have tried wsimport, but it is generating only .classes? My question is if i want to use spring ws, is it required to generate .java classes? If so where can i find the elipse plugin or how to generate the classes? Is there any other way we can do without generating these classes?

    Read the article

  • How do I customise date/time bindings using JAXWS and APT?

    - by Jordan Digby
    Im using JAXWS 2.1.7, using some classes to run through JAXWS's 'apt' to generate the WSDL. For dates, I use @XmlSchemaType(name="time") private Date wakeupTime; and this generates a schema with xs:time, but when this all comes out in XML, the value is something like <wakeupTime>1901-01-01T01:00:00 +10</wakeupTime> I want JUST the time portion to come! I think I want to use a custom converter to say that xs:time + java.util.Date should be printed and parsed in such-and-sucha manner, but I cant see that I can pass a bindings file to the apt routine. I can't (for historical & other reasons) use XMLGregorianCalendar - it has to be a java.util.Date. How do I specify a custom binding for the apt tool in jaxb

    Read the article

  • GWT and a jaxb objects

    - by arinte
    I am trying to use GWT to build objects on the client side that would be sent to a web service elsewhere. These objects are generate through JAX-WS which I am pretty sure uses jaxb to build objects from the xsds that are in the wsdl. Anyhow, GWT was supposed to be able to support this by ignoring annotations or whatever, but it isn't working for me. Here is one of the errors that I am getting: Line 4: The import javax.xml.bind cannot be resolve I am using GWT 2 and the Google plugin for Eclipse.

    Read the article

  • marshal Map<String, String> to .xml

    - by richardl
    If I have Map setup like: map.put("foo", "123"); map.put("bar", "456"); map.put("baz", "789"); then I want to do something like: for (String key : map.keySet().toArray(new String[0])) { // marshall out to .xml a tag with the name key and the // value map.get(key) } So what it will marshal out is something like: <map> <foo>123</foo> <bar>456</bar> <baz>789</baz> </map> Can I do this with some fancy JAXB annotations or is there something else that lends it self to dynamic element names? TIA

    Read the article

  • Does XSD allow simpleContent and complexContent at the same time?

    - by Willi Schönborn
    I want to write an xsd for the xmlrpc spec (and generate java classes out of it using jaxb). The xmlrpc spec allows values like: <value><int>123</int></value> <value><boolean>1</boolean></value> But at the same time it requires: If no type is indicated, the type is string. Which means i could receive something like this: <value>test123</value> which is equivalent to <value><string>test123</string></value> Is there a way to define this in an xsd.

    Read the article

  • Jaxb2Marshaller and primitive types

    - by Thomas Einwaller
    Is it possible to create a web service operation using primitive or basic Java types when using the Jaxb2Marschaller in spring-ws? For example a method looking like this: @Override @PayloadRoot(localPart = "AddTaskRequest", namespace = "http://example.com/examplews/") public long addTask(final Task task) throws AddTaskFault { // do something return 0; } I am using the maven jaxws plugin to generate the interface and model classes from my WSDL. When I try to call the webservice I get the following error: java.lang.IllegalStateException: No adapter for endpoint [...]: Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint I found out that if I change the method to that: @Override @PayloadRoot(localPart = "AddTaskRequest", namespace = "http://example.com/examplews/") public JAXBElement<Long> addTask(final JAXBElement<Task> task) throws AddTaskFault { final ObjectFactory objectFactory = new ObjectFactory(); return objectFactory.createAddTaskResponse(0L); } I am able to call it - but this signature is not compatible with the interface generated by the maven jaxws plugin. What can I do to configure either spring-ws to be able to use the first kind of implementation or to tell maven jaxws plugin to generate the second variant of the interface? UPDATE: My relevant spring-ws config entries look like that: <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> <property name="contextPath" value="com.example.examplews" /> </bean> <bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter"> <constructor-arg ref="marshaller" /> </bean> <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping"> <property name="order" value="1" /> </bean>

    Read the article

  • How to separate ear classloader and system classloader in JBoss 6?

    - by dskiles
    I'm trying to upgrade from JBoss 4.2.1 to JBoss 6. In JBoss 4.2.1, we are manually deploying our application as an exploded war and everything works beautifully. I'm running into problems because the application that I am trying to deploy uses versions of 3rd party libraries that are older than the ones that JBoss 6 now includes by default. The result of this is that I'm getting classloader conflicts all over the place and the application won't even start. At present, I have tried using the JBoss Classloading Documentation as well as the scanty bits of documentation for jboss-classloading.xml and haven't had any success. Has anyone out there managed to do this successfully? If you have, how did you do it? I've included a stack trace below in case it offers any useful information. Caused by: java.lang.Error: Error visiting "/C:/jboss6/server/default/deploy/app.war/WEB-INF/lib/jaxb-xjc-2.1.12.jar/1.0/com/sun/codemodel/JConditional.class" at org.jboss.classloading.plugins.vfs.VFSResourceVisitor.visit(VFSResourceVisitor.java:268) [jboss-classloading-vfs.jar:2.2.0.Alpha9] at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:407) [jboss-vfs.jar:3.0.0.CR5] at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5] at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5] at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5] at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5] at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:395) [jboss-vfs.jar:3.0.0.CR5] at org.jboss.classloading.plugins.vfs.VFSResourceVisitor.visit(VFSResourceVisitor.java:102) [jboss-classloading-vfs.jar:2.2.0.Alpha9] at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.visit(VFSDeploymentClassLoaderPolicyModule.java:181) [:2.2.0.Alpha8] at org.jboss.scanning.plugins.DeploymentUnitScanner.scan(DeploymentUnitScanner.java:111) [:1.0.0.Alpha7] at org.jboss.scanning.spi.helpers.UrlScanner.scan(UrlScanner.java:96) [:1.0.0.Alpha7] at org.jboss.scanning.deployers.ScanningDeployer.deploy(ScanningDeployer.java:90) [:1.0.0.Alpha7] at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.Alpha8] ... 41 more

    Read the article

  • Amazon EC2 and jbossws

    - by avjaz
    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 loading the wsdl by changing the private hostname to the public IP; that works, but when I try to call any of the operations I get a HostNotFoundException, I'm guessing due to the fact that the generated wsdl has the stanza: <service name='XXXService'> <port binding='tns:XXXBinding' name='XXXPort'> <soap:address location='http://domU-XX-XX-XX-XX-XX-XX.compute-1.internal:8080/xx/xx/xx'/> </port> </service> where http://domU-XX-XX-XX-XX-XX-XX.compute-1.internal is the internal dns of the ec2 instance. The wsdl is auto generated - Is there a JAXB annotation I can use so that I can force the generated wsdl to use the public dns of the EC2 instance? Many thanks -

    Read the article

  • JAXB does not call setter when unmarshalling objects

    - by Yaneeve
    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 that the custom validation occurs for this specific field every unmarshall call. What should I do? Code: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "LegalParams", propOrder = { "value" }) public class LegalParams { private static final Logger LOG = Logger.getLogger(LegalParams.class); @XmlTransient private LegalParamsValidator legalParamValidator; public LegalParams() { try { WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext(); LegalParamsFactory legalParamsFactory = (LegalParamsFactory) webApplicationContext.getBean("legalParamsFactory"); HttpSession httpSession = SessionHolder.getInstance().get(); legalParamValidator = legalParamsFactory.newLegalParamsValidator(httpSession); } catch (LegalParamsException lpe) { LOG.warn("Validator related error occurred while attempting to construct a new instance of LegalParams"); throw new IllegalStateException("LegalParams creation failure", lpe); } catch (Exception e) { LOG.warn("Spring related error occurred while attempting to construct a new instance of LegalParams"); throw new IllegalStateException("LegalParams creation failure", e); } } @XmlValue private String value; /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * @throws TestCaseValidationException * */ public void setValue(String value) throws TestCaseValidationException { legalParamValidator.assertValid(value); this.value = value; } }

    Read the article

  • XML/RDF to Java Objects with XSD

    - by bmucklow
    So here's the scenario...I have an XSD file describing all the objects that I need. I can create the objects in Java using JAXB no problem. I have an XML/RDF file that I need to parse into those objects. What is the EASIEST way to do this? I have been looking into Jena and have played around with it, but can't see how to easily map the XML/RDF file to the XSD objects that were generated. Here is a snippet of the XSD file as well as the XML/RDF file: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:a="http://langdale.com.au/2005/Message#" xmlns:sawsdl="http://www.w3.org/ns/sawsdl" targetNamespace="http://iec.ch/TC57/2007/profile#" elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns="http://langdale.com.au/2005/Message#" xmlns:m="http://iec.ch/TC57/2007/profile#"> <xs:annotation/> <xs:element name="Profile" type="m:Profile"/> <xs:complexType name="Profile"> <xs:sequence> <xs:element name="Breaker" type="m:Breaker" minOccurs="0" maxOccurs="unbounded"/> And the XML/RDF: <!-- CIM XML Output For switch783:(295854688) --> <cim:Switch rdf:ID="Switch_295854688"> <cim:IdentifiedObject.mRID>Switch_295854688</cim:IdentifiedObject.mRID> <cim:IdentifiedObject.aliasName>Switch_295854688</cim:IdentifiedObject.aliasName> <cim:ConductingEquipment.phases rdf:resource="http://iec.ch/TC57/2009/CIM-schema-cim14#PhaseCode.ABC" /> <cim:Switch.circuit2>0001406</cim:Switch.circuit2> <cim:Equipment.Line rdf:resource="#Line_0001406" />

    Read the article

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