unmarshalling

Java, UnmarshallingException caused by XML attribute with special chars: ;ìè+òàù-<^èç°§_>!£$%&/()=?~`'#;

Hi, my xml file has a tag with an attribute "containsValue" which contains the "special" characters you can see in the subject: <original_msg_body id="msgBodySpecialCharsRule" containsValue=";ìè+òàù-<^èç°§_>!£$%&/()=?~`'#;" /> in my xml schema the attribute has xs:string: <xs:attribute name="containsValue" type="xs:string" /> ...

Customizing error handling of JAXB unmarshall process

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="n...

How can I pass managed objects from one Process to another?

I have two assemblies that I'm trying to link together. One is a sort of background process that's built with WinForms and will be designed to run as a Windows Service. I have a second project that will act as a UI for the background process whenever a user launches it. I've never tried attempting something like this with managed code be...

Oracle 10g - JAXB unmarshalling is not working as expected

We're using Oracle 10g application server and deployed the Web service and trying to deploy the web service client. Server is working fine i.e.; marshalling is working fine. We're getting the output from the service properly but the search client is not unmarshalling (parsing) the response received. We're using all the tags under same na...

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

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

JAXB Unable To Handle Attribute with Colon (:) in name?

I am attempting to use JAXB to unmarshall an XML files whose schema is defined by a DTD (ugh!). The external provider of the DTD has specified one of the element attributes as xml:lang: <!ATTLIST langSet id ID #IMPLIED xml:lang CDATA #REQUIRED > This comes into the xjc-generated class (standard generation; no *.xjb magic) as: @XmlAt...

How to return an [out] variant with VT = VT_RECORD without creating memory leak in ole32.dll?

Hi, Purify is pointing memory leak in ole32.dll while returning a Variant with VT set to VT_RECORD as OUT parameter. I am using User Marshalling by generating proxy/stub dll from IDL. Can you suggest how to avoid this memory leak? Struct defined in IDL: { BSTR m_sFirst; BSTR m_sSecond; VARIANT m_vChildStruct; //This member encapsulate...

JAX-RS JSON java.util.Date Unmarshall

Hi, I'm using Jersey (jax-rs), to build a REST rich application. Everything is great, but I really don't understand how to set in JSON Marshalling and Unmarshalling converting option for dates and numbers. I have a User class: @XmlRootElement public class User { private String username; private String password; private jav...

Using RestEasy with Windows Live Service, how do you unmarshall the list of Contacts returned?

I'm trying to get my contacts from Windows Live using RestEasy After succesfully authenticating my user, I've made the call to https://livecontacts.services.live.com/users/@L@/rest/livecontacts Set the authentication header, added my id and my tokens If i make the call from command line using cUrl I get the expected output, but in my w...

Faster/more efficient alternatives to Ruby's Marshal?

I'm looking for a drop-in replacement of Ruby's Marshal capability, which hopefully has one or more of the following advantages over Marshal: faster serialization/deserialization more concise (or simply smaller) object-graph Thanks!! ...

Ommiting unwanted fileds from mapping files of castor

Hi All My input xml has some extra tags which I donot need,like this <College> <Address> Address of the college </Address> <Name> xyz </Name> </College> In this I dont need Address details.I just need 'Name' alone.So I have just mapped Name alone as below: <?xml version="1.0" encoding="UTF-8"?> <mapping> ...

3 counts of illegalannotationexceptions

I have never used JAXB before. I am working on a test harnesses project. I have around 20 different testcases. when i run my test i get this error. my structure is like A is the bestTestCase class. B extends A. C extends B. Base Class A: public Class A { public A(String t){ testName = t; } private String aData; privat...

Unmarshalling xml to a bean with a colleciton

I'm working with Redmine's xml rest api. The service returns xml like in the example below. I'm using the Jersey Client API to communicate with the restful service. Mapping the plain fields (id, name and so on) in project are no problem, but I'm having trouble with the trackers list. <project> <id>2</id> <name>Project X</name> ...

Problem in implementing Parcelable containing other Parcelable

I'm implementing Parcelable class that has another Parcelable insde. In OuterParcelable class: @Override public void writeToParcel(Parcel dest, int flags) { Bundle tmp = new Bundle(); tmp.putParcelable("innerParcelable", mParcelable); dest.writeBundle(tmp); and then: public OuterParcelable(Parcel parcel) { super(); ...

What is Serialization/Deserialization and marshalling/unmarshalling with example?

recently i read about interface iclonable,in that i studied about serialization and marshalling i like to know about that with examples. ...

Generating java classes from xsd files

Hi, I have got a xsd files from some thirdparty which used to be with "include" and not "import". I am using these xsd file to generate java files, using jaxb. The initial xsd structure resulted in output in which same classe were included in different packages. for example, if two packages were generated, "aa" and "bb", both included th...

Unmarshalling SOAP Envelope from file in Java

I want to unit-test the mapper objects that map/translate web service types generated by wsimport in to my own domain objects. I also want to test error-scenarios, such as SOAP faults and such, and I am thinking it would be best to test the mapper objects on authentic SOAP responses. I do not want to fire requests to the web service itse...

Demarshalling XStream errors

Hi everyone, I have successfully created an XML file using XStream and a custom converter. The custom converter marshalls an object so it is nicely readable by humans as follows: <Header clip="16:01:02:22 -&gt; 16:01:52:00" match clock="961"> <match filename="MatchName" name="Jets vs Giants" date="2009-11-29 16:00:00.0"/> </Header> ...

why does HTTPClient response produce JSON stream, when the same GET request in the browser shows XML response?

Hi, I am using HttpClient for the first time to make a request to a web service (defined by WADL), I'd like to unmarshall the response into a meaningful object, in the browser if I perform the Get request it response with XML. But when I display the response from the code it seems to be JSON. Am I missing a step? or is there a way th...

JavaBeanConverter Unmarshal fails to use Constructor

So I have a class with some objects as parameters, for example: public class Person { private String firstname; private String lastname; private School school; public Person(){ super(); } } public class School{ private String name; private String location; private Date founded; public School(){ super(); } public Schoo...