unmarshalling

Axis Marshaller

限于喜欢 提交于 2019-12-07 03:39:58
问题 I have a group of classes that were created using wsdl2java (Axis 1.4) and am looking for a way to unmarshal and marshal the data from/to String and Object. I have written a JAXB unmarshaller that works well for some of our newer internal objects since we used xjc to create the classes but do not have time to convert the old axis classes and need to find a marshal/unmarshal solution for the code as-is. Can somebody please point me in a direction. Thanks! 回答1: I did find an answer to my own

Intermittent ClassCastException from ElementNSImpl to own type during unmarshalling

青春壹個敷衍的年華 提交于 2019-12-07 01:02:37
问题 We are experiencing an exceedingly hard to track down issue where we are seeing ClassCastExceptions sometimes when trying to iterate over a list of unmarshalled objects. The important bit is sometimes , after a reboot the particular code works fine. This seems to point in the direction of concurrency/timing/race condition. I can confirm that neither the JAXBContext, nor the marshallers and unmarshallers are being used concurrently. We've gone as far as serializing access to them through

XML unmarshalling using JAXB

南楼画角 提交于 2019-12-06 13:40:36
问题 I have an XML file that I'm trying to unmarshal, but I cant figure out how to do it. XML looks like <config> <params> <param> <a>draft</a> <b>Serial</b> </param> <param> <a>amt</a> <b>Amount</b> </param> </params> <server> <scheme>http</scheme> <host>somehost.com/asdf</host> </server> </config> I could previously unmarshall when I had params as the root element and didnt have the server elements or config as root element. I added a config class to try to unmarshall this, but I dont know where

Nested json object deserializing using Delphi 2012

≡放荡痞女 提交于 2019-12-06 12:31:09
I'm working on a wrapper for dropbox in delphi 2012. The problem I'm running into is deserializing the json responses. When I make the request for a list of folders and files in my account I get a response that looks something like this: { "hash": "some_hash", "thumb_exists": false, "bytes": 0, "path": "/", "is_dir": true, "size": "0 bytes", "root": "dropbox", "contents": [ { "revision": 11, "rev": "b074cbcbb", "thumb_exists": false, "bytes": 0, "modified": "Mon, 23 Apr 2012 19:19:27 +0000", "path": "/Apps", "is_dir": true, "icon": "folder", "root": "dropbox", "size": "0 bytes" }, { "revision"

Unmarshal Inconsistent JSON in Go

旧巷老猫 提交于 2019-12-06 11:58:16
问题 I'm working with JSON that returns three different object types 'items','categories' and 'modifiers'. An example of the JSON can be viewed here. I created models for the three types of objects. But when I unmarshal I have selected one of the types to unmarshal the entire JSON to.(I know this cant be the correct way...) I then try to parse out the different items depending on what their type is identified as in the json field 'Type' and then append that object to a slice of the proper type. I

java unmarshall LocalDateTime error

大兔子大兔子 提交于 2019-12-06 09:39:48
This is my adapter class: public class LocalDateTimeAdapter extends XmlAdapter<String, LocalDateTime> { @Override public LocalDateTime unmarshal(String v) throws Exception { return new LocalDateTime(v); } @Override public String marshal(LocalDateTime v) throws Exception { return v.toString(); } } and this is an object-class where i want to store the date: @XmlAccessorType(XmlAccessType.FIELD) public class Object { @XmlJavaTypeAdapter(LocalDateTimeAdapter.class) private LocalDateTime time; public LocalDateTime getTime() { return time; } For some reason, i can't compile it. It shows that the

Convert XML file into an XML object having a List [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-12-06 07:42:05
This question already has answers here : Closed 6 years ago . Possible Duplicate: Best XML parser for Java How i can convert this xml file into an XML object? I have a XML like this . And i want to convert it into JAVA object. <P1> <CTS> Hello </CTS> <CTS> World </CTS> <P1> So I created following java classes with their properties. P1 class @XmlRootElement public class P1 { @XmlElement(name = "CTS") List<CTS> cts; } CTS class public class CTS { String ct; } Test Class File file = new File("D:\\ContentTemp.xml"); JAXBContext jaxbContext = JAXBContext.newInstance(P1.class); Unmarshaller

Parse MathType MTEF data from OLE binary string

可紊 提交于 2019-12-06 07:02:05
问题 There is a need to convert the MathType equations in the MS-WORD 2003 or below to MathML in order to render nicely on the the web. The MathType's built in function "Publish to MathPage" can do the job very nicely, but I want to integrate the equation conversion process in my C# application. Because I couldn't find any API references that the MathPage export interface is provided by the MathType SDK, I need to figure out a way to do the individual equation conversion by myself. The current

JAXB override @XmlElement type of list

自闭症网瘾萝莉.ら 提交于 2019-12-06 05:48:15
There's a simple class Bean1 with a sublist of type BeanChild1 . @XmlRootElement(name="bean") @XmlAccessorType(XmlAccessType.PROPERTY) public static class Bean1 { public Bean1() { super(); } private List<BeanChild1> childList = new ArrayList<>(); @XmlElement(name="child") public List<BeanChild1> getChildList() { return childList; } public void setChildList(List<BeanChild1> pChildList) { childList = pChildList; } } public static class BeanChild1 { ... } I am trying to override the class, to change the type of the list. The new child-class (i.e. BeanChild2 ) extends the previous one (i.e.

Jaxb Unmarshall with an unknown @XmlRootElement

三世轮回 提交于 2019-12-06 03:34:45
I cannot achieve to unmarshall an XML without knowing the root element. eg. <foo> <bar/> </foo> or <bar> <bar/> </bar> etc... I want to map the unmarshalling result on a class like : // @XmlRootElement ?? public class Container implements Serializable { private Bar bar; } I am always required to fix the @XmlRootElement . I searched how to set the @XmlRootElement at runtime without success. Any idea? I am in Spring Batch context and I can use the unmarshaller of my choice. Note : I cannot use @XmlElementDecl or an ObjectFactory as shown here because I don't know the name of the possibles root