Questions tagged [xml-serialization]

This tag refers to serialization technologies which use XML as a data format.

This tag refers to serialization technologies which use XML as a data format. In the context of .NET, it refers to the XmlSerializer class, less so to the DataContractSerializer class, still less to the SoapFormatter class.

4687 questions
2
votes
2 answers

Serialize an IntPtr using XmlSerializer

I'm wondering why the IntPtr type is not supported by the XmlSerializer implementation. When I try to serialize a class including a field of IntPtr type, the serialization fails telling me that IntPtr is not supported, and ignore that member. To…
Luca
  • 11,646
  • 11
  • 70
  • 125
2
votes
2 answers

Handling XML Serialization of read-only fields in C#

I've got a class that has a read-only property defined that is actually a reference to a very mutable object, and I'm wondering what the best way to handle the serialization of it is. For example: public class classA { public readonly classB B =…
Flynn1179
  • 11,925
  • 6
  • 38
  • 74
2
votes
2 answers

Converting Serialized Java Classes Between XML and Binary

I am using Java native serialization along with a dynamic proxy to save the parameters and returns of a series of method calls to a file. I would like to convert the binary file that is generated to and from XML. Is this something that I will need…
sylvanaar
  • 8,096
  • 37
  • 59
2
votes
1 answer

XML parsing error for control character: illegal xml character

I am dealing with API calls and retrieving xml which is described below. 《新加坡》住宿@戴斯旅店 Days Hotel…
Nikunj Soni
  • 297
  • 2
  • 13
2
votes
3 answers

Best approach for passing XML to a webservice?

I have XML files in a directory that I wish to get over to a webservice on a server that will validate them and return a true/false as to whether they are valid in construct and values etc. Reason for server side processing is that the validation…
anonym0use
  • 2,936
  • 4
  • 25
  • 26
2
votes
1 answer

RestSharp - XmlSerializer not using the DateFormat property

I encountered a problem with the RestSharp library. Defaultly, it serializes DateTime objects using the format dd/MM/yyyy HH:mm:ss. That doesn't work well with my WCF service that only seems to accept yyyy-MM-ddTHH:mm:ss, so I tried to alter the…
Near
  • 391
  • 4
  • 16
2
votes
2 answers

Boost serialization fails in release mode while working in debug

I am using boost serialization with xml files with a C++ program. When I test my program in debug mode, it is working fine. Then I try with the exact same file in release mode, but my program fails when loading the files. I even tried to generate…
0x26res
  • 11,925
  • 11
  • 54
  • 108
2
votes
1 answer

Deserializing XML with unknown element order

I'm trying to implement a client for a service with a really deficient spec. It's SOAP-like, although it has no WSDL or equivalent file. The spec also doesn't provide any information about the correct ordering of elements - they're listed…
Bobson
  • 13,498
  • 5
  • 55
  • 80
2
votes
1 answer

XmlDocument.Load(xml) generates No Root Element error from XmlSerializer serialized code

I have a class like so: [XmlRoot"MyMessageType")] public class MyMessageType : BaseMessageType { [XmlElement("MessageId")] //Property for MessageId ... //end properties. } This class contains a static method to create…
AllenG
  • 8,112
  • 29
  • 40
2
votes
2 answers

Serializing Object - Replacing Values

I've got a collection of around 20,000 objects that need to get persisted to my database. Now, instead of doing 20,000 insert statements, I want to pass all the records in using an XML parameter. As far as serializing the object and passing it into…
Jim B
  • 8,344
  • 10
  • 49
  • 77
2
votes
3 answers

FileNotFound exception when using XmlSerializer

When trying to serialize a type (a generic List which T is a class marked with XmlRootAttribute) into XML using XmlSerializer, a FileNotFoundException is thrown (sometimes) and serialization fails. It seems that XmlSerializer tries to create a…
mrtaikandi
  • 6,753
  • 16
  • 62
  • 93
2
votes
1 answer

Forcing xsi:type attribute on generated xml in JAXB

I need to force the xsi:type generation on fields because the xml will be deserialized into a different object through a xsl transformation sheet. Datatypes are defined with XSD schemas, anyone can use jaxb to generate classes and send data to the…
ntrp
  • 402
  • 5
  • 12
2
votes
2 answers

Simple, structurally typed XML data binding (without code generation or reflection)

I'm looking for a Java library that would allow me to marshal XML to a Java object tree, and vice versa. There are plenty of libraries that would allow me to bind XML to JavaBeans generated by some code generation tool, however, I don't need those…
Marat Salikhov
  • 6,367
  • 4
  • 32
  • 35
2
votes
5 answers

Can you use other formats beside XML with XMLHttpRequest?

I understand JSON can be used instead of XMLHttpRequest in Javascript, but can I make requests and get totally arbitrary data back? Like a custom text or binary format? Or is the interface limited to jSON and XML? I hope I get through what I wonder…
Prof. Falken
  • 24,226
  • 19
  • 100
  • 173
2
votes
1 answer

Cannot insert the node in the specified location in xml

I am creating xml from c# code.I am gettign the following error: Cannot insert the node in the specified location. My code to do so is: try { XmlDocument doc = new XmlDocument(); XmlNode docNode =…
xav xav
  • 231
  • 2
  • 5
  • 12