Commit Graph
150 Commits
Author SHA1 Message Date
josedonizetti e30d3314e2 validate if attribute is defined before check IsAny 2014-05-24 21:08:09 -04:00
Jose Donizetti 1690b16a73 add IsAny=true support for DataContractSerializer 2014-05-22 23:01:16 -04:00
Miguel de Icaza d28e7b7955 [System.Runtime.Serialization] Fix from Brendan Zagaeski for bug #17663 2014-02-24 21:16:29 -05:00
Miguel de Icaza c39718bbb3 Merge pull request #820 from brendanzagaeski/master
Bug 15572. Lookup KnownTypeCollection element types in MSSimpleNamespace
2014-02-12 15:31:12 -05:00
brendanzagaeski d0c24d73e5 Bug 15572. Lookup KnownTypeCollection element types in MSSimpleNamespace
This patch prevents the problem in https://bugzilla.xamarin.com/show_bug.cgi?id=15572. This change allows the DataContractSerializer to deserialize DataMembers that use an array KnownType, at least for the test case in the bug report.
2013-11-26 23:09:00 -05:00
brendanzagaeski df9535c5a4 Bug 15574. XML deserialization recursion: add array type to known_types?
One way to prevent https://bugzilla.xamarin.com/show_bug.cgi?id=15574 is to add the problematic array type to the `known_types`.

On the other hand, this might not be the intended use of `known_types`. In that case, perhaps a better fix would be to guard against recursion in the `foreach` loop:

	if (t != type)
		RegisterTypeAsKnown (t);
2013-11-26 22:47:48 -05:00
Rodrigo Kumpera ef3f9a6e80 Fix the build. 2013-04-23 17:29:16 -04:00
Atsushi Eno 44f3d6379a quick nullref fix for part of bugfix #11916. 2013-04-24 05:46:48 +09:00
Martin Baulig 91f11b20d7 Bug #5829: DataContractSerializer should not check for invalid characters. 2013-03-22 01:00:56 +01:00
Martin Baulig 54f7c82d2b DataContractSerializer changes for .NET 4.5.
* Move System.Runtime.Serialization.Json from System.ServiceModel.Web.dll
  into System.Runtime.Serialization.dll on the mobile profile.

* Add DataContractJsonSerializerSettings and DataContractSerializerSettings..
2013-03-12 21:15:56 -04:00
Martin Baulig 35992e86c7 System.Runtime.Serialization.DateTimeFormat 2013-03-12 17:23:00 -04:00
Rodrigo Kumpera 9b9effd98a Kill the MOONLIGHT define in System.Runtime.Serialization. 2013-02-11 13:01:10 -05:00
Marek Safar a61f1d1c1d ifdef same extension method which exists in 4.5 mscorlib 2012-12-04 18:47:01 +01:00
Atsushi Eno 62bf3c73c5 fix bug #7957: empty dictionary should not be read siblings as content. 2012-10-24 11:57:57 +09:00
Martin Baulig ea570f3a76 [WCF,Serialization] Improve and fully implement support for collection types.
* System.Runtime.Serialization/XsdDataContractImporter:
      Check ImportOptions.ReferencedCollectionTypes to determine the proxy type.

* System.ServiceModel.Description/MetadataImporter.cs:
      Very simply implementation of the 'State' property.

* System.ServiceModel.Description/DataContractSerializerMessageContractImporter.cs:
      Use it here.

* Test/Resources/WSDL: Added some sample .wsdl files for the new tests; adding
      these as resources to the test dll.

* Test/System.Runtime.Serialization: Added WsdlHelper.cs,
      XsdDataContractImporterTest2.cs and XsdDataContractExportTest2.cs
2012-10-09 23:04:08 +02:00
Martin Baulig e5e80eeae1 [#7299][Serialization]: Fixed and improved collection serialization.
* Implement "Interchangeable Collections" and Collection Interface Types.
  (see http://msdn.microsoft.com/en-us/library/aa347850.aspx)

* Add element type check for arrays.

* Identify custom collection types (must have a public parameterless
  constructor and an "Add" method with the correct argument type) and
  distinguish them from types which implement one or more of the
  collection interfaces without being a custom collection type.

* Add some checks for [CollectionDataContract].

* Added some NUnit tests for that.
2012-09-25 03:23:19 +02:00
Vinicius Jarina 82570e8ac9 Fix issue #242 DataContractSerializer fails to deserialize List<T> properties 2012-05-30 16:03:01 -03:00
Vinicius Jarina bd167248e9 Fix XML serialization of DateTimeOffset?. Fixes #3258
The nullable DateTimeOffset was not properly handled when serialized.
The deserialization changed to work with DateTimeOffset?.
Avoided "i:type" attribute when serializing Nullable type.
2012-05-08 16:14:23 -03:00
Vinicius Jarina 4ef4e5844b Removed code commented 2012-05-08 16:14:22 -03:00
Dave Ferguson 3b6cb0a486 Fix DataContractSerializer with duplicate qname
- Fix bug 4794 by searching the SerializationMap with both type and
  qname in all but several cases (see bug report comments)

- Add separate list for known types to mimic behavior of the .NET
  runtime

- Make previous test fixtures public so that the unit tests will be run

- Remove unused private method

- Add unit test for bug 4794
2012-05-03 01:56:17 -04:00
Vinicius Jarina 2bfced8937 Fix bug #2843: WCF: SerializationException when processing response that contains a nullable enum
Fix deserialization of objects with Nullable user-types. Deserialize use internal user-type of a Nullable object to lookup QName on deserialize.
2012-03-10 20:55:33 -03:00
Marek Safar f7763d0d78 Fix few more warnings 2012-02-17 12:37:26 +00:00
Atsushi Eno caba2b77f9 Give prefix "i" for xsi:nil. Patch by Alexander Riman, fixes pt.2 of #1198. 2011-10-24 23:51:57 +09:00
Atsushi Eno b737e5542f Implement support for generic data contract type name with "{x}". 2011-06-28 18:01:38 +09:00
Atsushi Eno e0be05d381 Look for KnownTypeAttributes on known types (recursively). Fixed bug #695203. 2011-05-23 19:27:55 +09:00
Atsushi Eno 419fee3d9b CanImport() just returns false, without throwing error. 2011-05-10 22:02:20 +09:00
Atsushi Eno da1f191f52 support import of xs:anyType, as well as make couple of minor fixes. 2011-05-10 21:45:45 +09:00
Atsushi Eno de50f78581 Update XsdDataContractImporter.CanImport and implement ImportXmlType. 2011-05-10 17:40:35 +09:00
Atsushi Eno 7dee1a27a0 Allow xsi:nil for void. Fixed client side of bug #687580. 2011-05-09 13:50:38 +09:00
Atsushi Eno b671fac2c6 Looks like xs:any is allowed under certain condition in XsdDataContractImporter.
But I don't understand why :(
2011-04-28 23:40:00 +09:00
Atsushi Eno 93752ff1c4 moonlight does not like XmlSchemaType but nasty code in KnownTypeCollection :( 2011-04-28 22:08:08 +09:00
Atsushi Eno c05c0686c0 ...and do return Type for all known xs:* types in XsdDataContractImporter. 2011-04-28 20:31:24 +09:00
Atsushi Eno f85bbe3845 Do not reject xsd:* types that are not listed in KnownTypeCollection.
e.g. xs:token.
2011-04-28 20:06:14 +09:00
Atsushi Eno 7f9aff3203 RooArray types were rejected as unknown when it is at root. Fixed bug #688414. 2011-04-21 16:19:15 +09:00
Atsushi Eno be5f140d36 Implement support for KnownTypeAttribute.MethodName. 2011-04-15 15:40:42 +09:00
Atsushi Eno 71ffb28338 Looks like WCF serializer supports XmlNode, so we do as well.
for details: http://msdn.microsoft.com/en-us/library/aa347876.aspx

Fixed bug #682957.
2011-03-28 17:09:25 +09:00
Atsushi Eno d7796bf493 In some collection case, xsi:type is explicitly written. Try to copy that behavior. 2011-03-10 14:33:02 +09:00
Atsushi Eno b1d261b975 Some attempts to make KnownTypeCollection parallel access safe. 2011-03-09 22:50:25 +09:00
Atsushi Eno 0aab2d47c7 Make sure to call MoveToContent() to correctly determine node type.
Fix "Dictionary deserialization from xml with indent" issue.
2011-03-08 14:52:04 +09:00
Atsushi Eno c3cb165080 DateTimeOffset child elements have fixed namespace. 2011-03-08 11:01:57 +09:00
Atsushi Eno 94c253cdbe Couple of fixed to support new DateTimeOffset serialization in .NET WCF. 2011-03-07 16:45:33 +09:00
Atsushi Eno 8753386e4b MakXsdDataContractExporter refactoring to generally use SerializationMap.XmlName.
Fixed bug #670539.
2011-02-17 00:55:15 +09:00
Atsushi Eno 463d8ebf82 Don't reject serialization map for existing different (but same-purpose) type. 2011-02-16 18:48:06 +09:00
Atsushi Eno 1d62f3e9e5 xsi:type parsing is wrong in default namespace resolution.
Fixed case #3 in bug #652331.
2011-02-16 18:02:28 +09:00
Atsushi Eno f4dfb13cc7 KnownTypeCollection; recursively registered type was not added to the collection while it is "registered" state. 2011-02-16 16:04:15 +09:00
Atsushi Eno 8e916dc39c There's a tricky namespace-mismatching deserialization in .NET implementation.
Fixed bug #666333.
2011-02-08 17:09:26 +09:00
Atsushi Eno ab2cc9fed9 Members in the base type in different namespace are serialized in base ns.
When the serializer serializes a Type B which is derived from A, it used to
serialize member M in A as in namespace_of_B, not in namespace_of_A.

This should fix bug #652331.
2011-02-01 15:53:05 +09:00
Atsushi Eno 4a5f7c742c Contract-based type must ensure that the base type is also contract-based.
Fixed bug #661987 on WCF side.
2011-01-20 16:16:56 +09:00
Atsushi Eno 1d2fc1166f Fix enum serialization too. 2010-12-14 00:11:33 +09:00
Lluis Sanchez 6eb0ebd56c Fix flags enum deserialization
Flag enums values can be a composition of several
values separated by spaces. The deserializer now
properly handles this case.
2010-12-13 13:49:34 +01:00