unmarshalling

Unmarshalling Error: unexpected element (uri:url, local:“objectname”). Expected elements are <{}objectname>

筅森魡賤 提交于 2020-01-13 09:25:09
问题 I'm using jaxb2-marshaller to generate classes to communicate with a webservice. Java-classes are generated with use of some wsdl files. Everything is okay now, but when I'm trying to use some of the generated classes, i got this unmarshalling error, altough I use the generated ObjectFactory classes. Some of the stack: org.springframework.ws.soap.client.SoapFaultClientException: Unmarshalling Error: unexpected element (uri:"http://xxxxxxxxx", local:"customer"). Expected elements are <{

Add schema location to JAXB unmarshaller

ぃ、小莉子 提交于 2020-01-06 16:21:47
问题 I am facing the below error when JABX unmarshaller tries to unmarshall the xml Exception in thread "main" javax.xml.bind.UnmarshalException - with linked exception: [org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 456; The prefix "xsi" for attribute "xsi:nil" associated with an element type "customerProductStatus" is not bound.] When I looked at the xml being returned from the server , it is the below : <customerProductStatus xsi:nil = "true"></customerProductStatus> I don't see

Cast json that contains interface in properly struct

眉间皱痕 提交于 2020-01-06 05:36:14
问题 i'm unable to cast the following json in a struct in Golang, received from Kraken API: { "error": [], "result": { "LINKUSD": { "asks": [ ["2.049720", "183.556", 1576323009], ["2.049750", "555.125", 1576323009], ["2.049760", "393.580", 1576323008], ["2.049980", "206.514", 1576322995] ], "bids": [ ["2.043800", "20.691", 1576322350], ["2.039080", "755.396", 1576323007], ["2.036960", "214.621", 1576323006], ["2.036930", "700.792", 1576322987] ] } } } Using json-to-go , he gives me the following

JAXB marshal to string works differently on different computers

情到浓时终转凉″ 提交于 2020-01-06 05:26:35
问题 I have this test java app: @XmlRootElement public class Car { @XmlElement(namespace="http://www.example.com/CAR_NAME") private String name; @XmlElement(namespace="http://www.example.com/CAR_PRICE") private int price; @XmlElement(namespace="http://www.example.com/CAR_BUS") private Bus bus; //constructors, getters and setters @XmlRootElement public class Bus { @XmlElement(namespace="http://www.example.com/BUS_NAME") private String name; @XmlElement(namespace="http://www.example.com/BUS_PRICE")

JAXB marshal to string works differently on different computers

↘锁芯ラ 提交于 2020-01-06 05:26:04
问题 I have this test java app: @XmlRootElement public class Car { @XmlElement(namespace="http://www.example.com/CAR_NAME") private String name; @XmlElement(namespace="http://www.example.com/CAR_PRICE") private int price; @XmlElement(namespace="http://www.example.com/CAR_BUS") private Bus bus; //constructors, getters and setters @XmlRootElement public class Bus { @XmlElement(namespace="http://www.example.com/BUS_NAME") private String name; @XmlElement(namespace="http://www.example.com/BUS_PRICE")

how to map same value to two different fields in jaxb while marshalling and unmarshalling

烂漫一生 提交于 2020-01-06 04:10:16
问题 I have a xml tag Hello for which there is a field like below in my java class HelloWorld{ @XmlElement private String name; } While unmarshalling this successfully assigns Hello value to name variable.Now I want to create a new xml from THIS java object(HelloWorld) for which I am doing the marshalling but in this case I want a xml tag as instead of in my xml. How can I acheive this in Jaxb? Both Xml are not in my control so I cannot change the tag name EDIT: Incoming XMl - helloworld.xml

JaxB unmarshal custom xml

↘锁芯ラ 提交于 2020-01-06 02:28:07
问题 I'm currently attempting to unmarshal some existing XML into a few classes I have created by hand. Problem is, I always get an error that tells me, JaxB expects a weather element but finds a weather element. (?) javax.xml.bind.UnmarshalException: unexpected element (uri:"http://www.aws.com/aws", local:"weather"). Expected elements are <{}api>,<{}location>,<{}weather> I tried with and without "aws:" in the elements' name. Here's my weather class: @XmlRootElement(name = "aws:weather") public

Marshaling structure to single line of string

可紊 提交于 2020-01-05 12:34:54
问题 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public class Comarea { [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1)] public string status; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)] public string operationName; } public static void StringToObject(string buffer, out Comarea comarea) { IntPtr pBuf = Marshal.StringToBSTR(buffer); comarea = (Comarea)Marshal.PtrToStructure(pBuf, typeof(Comarea)); } I can create object from single line of string but I can not do

Marshal save menu item of jlist to XML and unmarshal load menu items

只谈情不闲聊 提交于 2020-01-05 08:23:12
问题 I have been doing research on here and have been searching for a solution to the problem. I am new to java so I don't know all of the syntax. I am trying to get my code to transfer items from create methods for the save and load menu items. The save event handler should call a method save() and save the list of parts in the right panel to an XML file. The load event handler should call a method load() and it should display the unmarshalled data in the right panel. I am not familiar with JAXB

golang : Unmarshal: json: cannot unmarshal array into Go value of type main.MonitorServerInfo

丶灬走出姿态 提交于 2020-01-03 05:39:48
问题 json: cannot unmarshal array into Go value of type config json: { "monitor_servers_info":[ { "server_info":{ "host":"127.0.0.1", "port":28081, "magic":"magic0", "params":"all", "interval":10000 } }, { "server_info":{ "host":"127.0.0.1", "port":28080, "magic":"magic1", "params":"all", "interval":10000 } } ], "sentry_server":{ "host":"127.0.0.1", "port":80 }, "deadtime":"110000" } and my golang code like this: type ServerInfo struct { Host string `json:"host"` Port int64 `json:"port"` Magic