84 Commits
Author SHA1 Message Date
Alexander Köplinger 112631f5c6 [bcl] Add missing APIs for netstandard parity and expose a few APIs on mobile
This ensures we're compliant with the upcoming netstandard2.0 API surface area.
2016-09-23 17:50:06 +02:00
Ludovic Henry 249daf43de [mcs] Replace NET_2_1 by MOBILE
NET_2_1 is also defined whenever we define MOBILE, so they have the same effect. Silverlight was 2.1 but it's been dead for a while now, and we do not even support it.
2016-08-18 16:34:36 +02:00
Atsushi Eno 4add6e6c44 [xml] add missing CONFIGURATION_DEP 2015-02-25 07:18:34 +08:00
Atsushi Eno d6bd25591b import System.Diagnostics.Trace etc. from referencesource. 2015-02-25 00:54:38 +08:00
Atsushi Eno 93ce056a76 Merge pull request #1496 from echampet/serializers
System.Xml.Serialization: fix xml serializers generation for Web Services
2015-02-13 05:08:10 +08:00
Zoltan Varga 0985d4aa4b [bcl] Remove NET_2_0 defines from the class libs. This has been done using: unifdef -t -DNET_2_0 -o <filename> <filename>. 2015-01-13 15:29:38 -05:00
Etienne CHAMPETIER 81057618ac System.Xml.Serialization: fix xml serializers generation for Web Services
(add a reference to System.Web.Services)

Without this patch we get the following exception after multiple call
to a soap web services:
Error while compiling generated serializer
/tmp/24ee1170/4996ddb2.cs(2519,27) : warning CS1522: Empty switch block
/tmp/24ee1170/4996ddb2.cs(969,29) : error CS0012: The type `System.Web.Services.Protocols.SoapHeader' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Signed-off-by: Frederic Mestayer <[email protected]>
Signed-off-by: Etienne CHAMPETIER <[email protected]>
2015-01-09 15:02:10 +01:00
Zoltan Varga 03aee949f1 Merge pull request #1200 from akoeplinger/remove-jvm
[Cleanup] Remove TARGET_JVM
2014-08-28 19:17:43 -04:00
Marcos Henrich baa495e78b Serializer were not generated if generationThreshold was changed. 2014-08-27 22:20:00 +08:00
Marcos Henrich 526cbd5ced Changed UsageCount and generationThreshold to zero based. 2014-08-22 21:46:38 +08:00
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
Martin Baulig 3fee2dd792 Trivial API additions. 2013-03-12 17:22:59 -04:00
Rodrigo Kumpera 8752d92528 Kill MOONLIGHT from System.Xml. 2013-02-11 16:03:40 -05:00
Martin Baulig 7d170f400d Sync parameter names with .NET. 2012-06-03 04:02:28 +02:00
Sebastien Pouliot 4925054bb0 Make some S.X.S types compatible with the SL API (for SDK)
* XmlAnyElementAttributes.cs:
* XmlArrayItemAttributes.cs:
* XmlElementAttributes.cs:
	Under Silverlight API this implement IList only (does not
inherit from CollectionBase).

* XmlCustomFormatter.cs:
* XmlSerializationWriterInterpreter.cs:
	Use a Convert.ChangeType override that exists in SL API

* XmlReflectionImporter.cs: Provide an alternative for (missing in SL)
Enum.GetNames and select available (in SL) overloads for parsing and
formatting for enums

* XmlSerializationReader.cs: Fix ToEnum API to use IDictionary (in SL)
instead of Hashtable (even if the SL4 docs still states the later)

* XmlSerializationReaderInterpreter.cs:
* XmlTypeMapping.cs:
	Use the default (identical to nonPublic being false) when using
	Activator.CreateInstance under SL

* XmlSerializationWriter.cs: Internally use a Queue<T> instead a a Queue
(not available in SL). Also Namespaces (ArrayList) is replaced by
XmlNamespaces (IList) in SL API.

* XmlSerializer.cs: Do not use environment variables in MOONLIGHT (like
the rest of MOBILE). Use Encoding.UTF8 instead of ENcoding.Default since
the later does not exist in SL.

* XmlSerializerImplementation.cs: SL version use IDictionary instead of
Hashtable for properties.

* XmlSerializerNamespaces.cs: Internally use a generic Dictionary
* instead
of a ListDictionary (which is not available in SL)
2011-05-06 08:40:41 -04:00
Atsushi Eno 8fe0d1c078 Prepare for new System.Xml.Serialization.dll build (moonlight sdk assembly). 2011-04-15 15:00:40 +09:00
Lluis Sanchez 3dc10b0fd1 Throw correct exceptions when using generated serializer
Invocations to generated serializers are done through
reflection, so exceptions are masked by TargetInvocationException.
The inner exception has to be rethrown so that the client
code gets the correct exception.
2010-12-13 13:49:34 +01:00
Jb Evain b2b1e43507 Fix the monodroid and monotouch profile builds 2010-09-08 18:48:36 +02:00
Jb Evain 0253e041a7 Enable the System.Xml build for monodroid 2010-09-08 18:48:29 +02:00
Jb Evain 561bf6b6b2 bring a net_2_0 feature set to monotouch
svn path=/trunk/mcs/; revision=140606
2009-08-25 10:18:20 +00:00
Gonzalo Paniagua Javier 070f6cbea3 2008-12-10 Gonzalo Paniagua Javier <[email protected]>
* XmlSerializer.cs: updated to work with shadowcopy fixes.


svn path=/trunk/mcs/; revision=121275
2008-12-11 04:19:05 +00:00
Atsushi Eno 11ab97e09f 2008-09-19 Atsushi Enomoto <[email protected]>
* XmlSerializer.cs : revert previous change and fix sys.data tests.


svn path=/trunk/mcs/; revision=113521
2008-09-19 12:47:57 +00:00
Atsushi Eno 0f484f3d35 2008-09-17 Atsushi Enomoto <[email protected]>
* XmlSerializer.cs : in 2.0 profile it seems to create XmlReader
	  for stream and textreader, that skips whitespaces.


svn path=/trunk/mcs/; revision=113307
2008-09-17 13:29:18 +00:00
Atsushi Eno c0cd23c750 2007-08-10 Atsushi Enomoto <[email protected]>
* XmlSerializer.cs : use WhitespaceHandling.Significant when creating
	  XmlTextReader. Fixed bug #82372. No tests should be added for it.


svn path=/trunk/mcs/; revision=83799
2007-08-10 07:04:54 +00:00
Adar Wesley bb05ca1050 2007-05-14 Adar Wesley <[email protected]>
* XmlSchemaExporter.cs: added missing overload for method ExportAnyType.

        * XmlSchemas.cs: added missing methods Add, AddReference, Contains,
        GetSchemas.

        * XmlSerializationReader.cs: added missing method AddReaderCount.

        * XmlSerializationWriter.cs: added missing overload WriteStartElement.

        * XmlSerializer.cs: added missing overload Serialize.


svn path=/trunk/mcs/; revision=77340
2007-05-14 11:48:15 +00:00
Atsushi Eno 8db245f202 2006-11-01 Atsushi Enomoto <[email protected]>
* XmlSerializationGeneratedCode.cs : removed InternalSyncObject.
	* SerializationCodeGenerator.cs : since IXmlSerializerImplementation
	  became a class, it needs explicit "override".
	  Since InternalSyncObject is gone, it needs another lock target.
	* IXmlSerializerImplementation.cs : removed.
	* XmlSerializerImplementation.cs : added.
	* XmlSerializer.cs : removed extra GenerateSerializer() overloads.
	  IXmlSerializerImplementation -> XmlSerializerImplementation.
	* XmlSchemas.cs : removed Schemas. hacked Compile().
	  Now it implements IEnumerable<XmlSchema>.
	* XmlSchemaEnumerator.cs : added missing type.


svn path=/branches/atsushi/mcs/; revision=67230
2006-11-01 19:52:06 +00:00
Gert Driesen 5a4fcc6e61 * XmlSerializerTests.cs: Added a few tests. Fixed coding style.
* XmlSerializer.cs: Output namespace declarations in same order as MS.

svn path=/trunk/mcs/; revision=66530
2006-10-10 19:54:54 +00:00
Gert Driesen b5eb88c87f * DeserializeTest.cs: Added several tests.
* XmlSerializerTestClasses.cs: Added test classes for encoded SOAP.
* XmlSerializerTests.cs: Added new tests and fixed existing test.
* XmlReflectionImporterTests.cs: Added test for invalid default
values.
* SoapReflectionImporterTests.cs: Fixed numbering of tests.
* XmlSerializer.cs: Corrected exception message when deserialization
fails.
* SerializationCodeGenerator.cs: Added support for flag enums.
* XmlReflectionImporter.cs: Use InvalidOperationException wrapper for
all exceptions that occur while reflecting member. Validate default
values to match MS.
* SoapReflectionImporter.cs: Revert small part of previous patch as
XmlSerializer expects enum value.

svn path=/trunk/mcs/; revision=66524
2006-10-10 17:53:49 +00:00
Konstantin Triger fb22f7e715 enable compilation using ms csc compiler
svn path=/trunk/mcs/; revision=63412
2006-08-06 14:14:12 +00:00
Gert Driesen 9c4805562a * DeserializeTests.cs: Enabled tests for bug #77530.
* XmlSerializerTests.cs: Enabled tests for bug #77530.
* XmlTypeMapping.cs: EnumMapMember now also stores value for enums.
Modified EnumMapping.GetXmlName to use XmlCustomFormatter to support
serialization of integral value to enum constant name, and made sure
the exceptions we throw match those of MSFT. In EnumMapping.GetEnumName
throw InvalidOperationException if no matching enum constant exists.
In EnumMap ctor, initialize arrays holding XML names, enum names and
enum values.
* XmlSerializationReaderInterpreter.cs: Pass full type name to
EnumMapping.GetEnumName for construction of exception message.
* XmlSerializer.cs: In Deserialize, wrap InvalidOperationException
and InvalidCastException in another InvalidOperationException to match
MSFT. In Serialize, wrap InvalidOperationException, InvalidCastException
and the inner exception for a TargetInvocationException in an
InvalidOperationException to match MSFT.
* SerializationCodeGenerator.cs: In GenerateGetXmlEnumValue, use
XmlCustomFormatter.FromEnum in order to also support serialization
integral value to enum constant name. In 2.0 profile, throw
InvalidOperationException if numeric value cannot be serialized into
an enum constant value. In GenerateSingleEnumValue, no longer attempt
to parse unknown constant value but instead report it as
InvalidOperationException. Use string.Length instead of "" comparison
to check whether a string is empty. Fixed compiler warnings in
generated code (possible empty statement).
* XmlSerializationWriterInterpreter.cs: Pass full type name to
EnumMap.GetXmlName.
* XmlSchemaImporter.cs: Pass full type name to EnumMap.GetEnumName
to allow it to be used in exception messag* XmlReflectionImporter.cs.
Use FieldInfo instead of MemberInfo for enum fields. Use IsDefined 
instead of GetCustomAttributes for checking if a certain attribute
 is defined. Use integral value of enum constant in EnumMapMember ctor.
* SoapReflectionImporter.cs: Use FieldInfo instead of MemberInfo for
enum fields. Use IsDefined instead of GetCustomAttributes for checking
if a certain attribute is defined. Use integral value of enum constant
in EnumMapMember ctor.
es.

svn path=/trunk/mcs/; revision=57761
2006-03-10 04:37:54 +00:00
Lluis Sanchez ce5affe08f 2006-02-21 Lluis Sanchez Gual <[email protected]>
* XmlSerializer.cs: Fix the previous fix.
	

svn path=/trunk/mcs/; revision=57094
2006-02-21 15:25:32 +00:00
Lluis Sanchez edb5d9366d 2006-02-21 Lluis Sanchez Gual <[email protected]>
* XmlSerializer.cs: Added option to avoid falling back to the
	interpreted serializer if the code generator fails. To be used
	in the test suite.


svn path=/trunk/mcs/; revision=57091
2006-02-21 13:30:12 +00:00
Lluis Sanchez 1adae42f73 2005-06-28 Lluis Sanchez Gual <[email protected]>
* XmlSerializer.cs: Fix race between XmlSerializer and the
	serializer generator.


svn path=/trunk/mcs/; revision=46655
2005-06-28 16:20:50 +00:00
Andrew Skiba d2d0b0ff38 XmlSerializer.cs: fixed a typo - wrong TARGET_JVM condition
svn path=/trunk/mcs/; revision=42752
2005-04-10 08:41:26 +00:00
Andrew Skiba 19090b83f8 XmlSerializer.cs: added TARGET_JVM that does not support on-the-fly code generation.
svn path=/trunk/mcs/; revision=42625
2005-04-07 07:57:15 +00:00
Gonzalo Paniagua Javier 62efe62af7 2005-01-18 Gonzalo Paniagua Javier <[email protected]>
* XmlSerializer.cs: only print the results if there's an error
	compiling.


svn path=/trunk/mcs/; revision=39119
2005-01-18 21:45:08 +00:00
Lluis Sanchez efb43a36d5 2004-11-30 Lluis Sanchez Gual <[email protected]>
* XmlCodeExporter.cs, XmlSerializer.cs, XmlSchemaImporter.cs: Fixed some
	compilation warnings.


svn path=/trunk/mcs/; revision=36831
2004-11-30 09:02:13 +00:00
Lluis Sanchez d8615d9cf4 * XmlSerializer.cs: When the XmlReader is created by XmlSerializer, use
Normalization==true by default.

svn path=/trunk/mcs/; revision=33264
2004-09-03 11:12:00 +00:00
Lluis Sanchez 5221e53fda * CodeExporter.cs: Added private constructor.
* CodeGenerationOptions.cs: Set the correct enum values.
	* CodeIdentifier.cs: Added private constructor.
	* SchemaImporter.cs: Added internal constructor.
	* XmlMapping.cs, XmlSerializer.cs: 2.0 api fix.
	* XmlMemberMapping.cs, XmlSchemaImporter.cs, XmlSerializationWriter.cs: Added 2.0 stubs.
	* XmlSchemaProviderAttribute.cs, XmlSerializerAssemblyAttribute.cs,
	  XmlSerializerVersionAttribute.cs: Set correct attribute usage.
	* XmlSerializationReader.cs: Added missing setter for DecodeName.

svn path=/trunk/mcs/; revision=30970
2004-07-09 23:19:41 +00:00
Lluis Sanchez 2db3de1fd5 * XmlSerializer.cs: Fix fix.
svn path=/trunk/mcs/; revision=30870
2004-07-08 14:02:34 +00:00
Lluis Sanchez a8ccb82ef3 * IXmlSerializerImplementation.cs: Compile as internal in NET_1_1.
* ReflectionHelper.cs: New method for generating map keys.
	* SerializationCodeGenerator.cs: Added support for generating the serializer
	  contract class, needed for 2.0.
	* SerializationSource.cs: Use Type[] instead of ArrayList for storing
	  extra types.
	* SoapReflectionImporter.cs, XmlReflectionImporter.cs: Assign extra types
	  as Type[]. Added check that makes sure that enums being serialized are
	  public.
	* XmlMapping.cs: Added internal GetKey method.
	* XmlSerializer.cs: Added support for IXmlSerializerImplementation.
	  Added first bits to support loading of serializers from pre-generated
	  assemblies.
	* XmlSerializerFactory.cs: Mostly implemeted.

svn path=/trunk/mcs/; revision=30867
2004-07-08 13:39:12 +00:00
Lluis Sanchez c397230784 * CodeIdentifier.cs: Removed constructor for NET_2_0.
* SoapCodeExporter.cs, SoapSchemaImporter.cs, XmlCodeExporter.cs,
	  XmlMapping.cs, XmlMemberMapping.cs, XmlReflectionImporter.cs,
	  XmlSchemaExporter.cs, XmlSchemaImporter.cs, XmlSchemas.cs,
	  XmlSerializationReader.cs, XmlSerializationWriter.cs, XmlSerializer.cs,
	  XmlSerializerNamespaces.cs: Added 2.0 stubs.
	* XmlMembersMapping.cs, XmlTypeMapping.cs: 2.0 fixage.
	* IXmlTextParser.cs, CodeExporter.cs, CodeGenerationOptions.cs,
	  ImportContext.cs, SchemaImporter.cs, SchemaImporterExtension.cs,
	  SchemaImporterExtensionCollection.cs, XmlDeserializationEvents.cs,
	  XmlSchemaProviderAttribute.cs, XmlSerializationGeneratedCode.cs,
	  XmlSerializerAssemblyAttribute.cs, XmlSerializerFactory.cs,
	  XmlSerializerVersionAttribute.cs: New files. More 2.0 stubs.

svn path=/trunk/mcs/; revision=30757
2004-07-05 18:12:19 +00:00
Duncan Mak 8fa6e766dd Add MIT license to System.XML.DLL
svn path=/trunk/mcs/; revision=30055
2004-06-21 18:07:31 +00:00
Atsushi Eno a5eaabf6f1 2004-06-18 Atsushi Enomoto <[email protected]>
* CodeIdentifier.cs, CodeIdentifiers.cs, MapCodeGenerator.cs,
	  SerializationCodeGenerator.cs, SerializationSource.cs,
	  TypeTranslator.cs, XmlAttributeOverrides.cs, XmlCustomFormatter.cs,
	  XmlSerializationReader.cs, XmlSerializationWriter.cs,
	  XmlSerializer.cs, XmlTypeMapMemberElement.cs, XmlTypeMapping.cs
	  : Globalization fixes.
	    In XmlCustomFormatter.GenerateToXmlString() time was not
	    generated correctly.
	    Replaced all CRLF XmlAttributeOverrides.cs into LF.

svn path=/trunk/mcs/; revision=29865
2004-06-18 09:50:34 +00:00
Lluis Sanchez 304353fc3f * SerializationCodeGenerator.cs, XmlSerializationReaderInterpreter.cs:
When deserializing an encoded method response, if the return type of the
	  method is Object, assign to it the first element of the message, whatever
	  it is.
	* XmlSerializationReader.cs:
	* SoapReflectionImporter.cs, XmlReflectionImporter.cs: Set IsReturnValue of
	  the imported member.
	* TypeTranslator.cs: Added method to safely get a primitive TypeData.
	* XmlSerializationReader.cs: Don't throw an exception when the CLR type for
	  a given xsi type is not found. Just read it as primitive type.
	* XmlTypeMapMember.cs: Added IsReturnValue property.
	* XmlTypeMapping.cs: Added ReturnMember property.
	* XmlSerializer.cs: Reference System.Data when compiling the serializer.

svn path=/trunk/mcs/; revision=26836
2004-05-06 15:08:58 +00:00
Lluis Sanchez 787d5c6931 XmlSerializer.cs: Enable serializer generation by default.
svn path=/trunk/mcs/; revision=26580
2004-05-03 11:38:52 +00:00
Lluis Sanchez c946a0cebc * CodeIdentifier.cs: Limit the length of identifiers.
* MapCodeGenerator.cs: Do not generate base class if it is an XmlNode.
	  Generate types using GetDomType, so if the type is an array, it creates
	  the correct combination of types.
	* SerializationCodeGenerator.cs, XmlTypeMapping.cs: When trying to parse
	  an enum, if the string is empty and the enum has [Flags], then return 0
	  as value. This fixes bug #55509.
	* XmlSchemaImporter.cs: Added check for redefines of attribute groups. They
	  are not supported. Another check: a simple type cannot be enum if it does
	  not have any enum facet.
	  And another fix: use string as default type for attribtues.
	* XmlSchemas.cs: Fixed search for schema elements. An schema may import
	  other schemas. An imported schema would not be in the table, but its
	  elements (although from another namespace) would be in the schema that
	  imported it. So, we need know to check for every schema in the table.
	* XmlSerializer.cs: Added environment variable to help debugging code
	  generator output.

svn path=/trunk/mcs/; revision=23957
2004-03-12 15:57:13 +00:00
Lluis Sanchez 95d2d48bb3 * SerializationCodeGenerator.cs: Added support for generation of readers
and writers for several maps in a single class. Added support for
	  XmlMemberMapping. Fixed generation of serializers that use encoded format.
	* SoapAttributeAttribute.cs, SoapAttributeOverrides.cs, SoapAttributes.cs,
	  SoapElementAttribute.cs, SoapEnumAttribute.cs, SoapTypeAttribute.cs,
	  XmlAnyElementAttribute.cs, XmlAnyElementAttributes.cs, XmlArrayAttribute.cs,
	  XmlArrayItemAttribute.cs, XmlArrayItemAttributes.cs, XmlAttributeAttribute.cs,
	  XmlAttributeOverrides.cs, XmlChoiceIdentifierAttribute.cs, XmlRootAttribute.cs,
	  XmlElementAttribute.cs, XmlElementAttributes.cs, XmlEnumAttribute.cs,
	  XmlReflectionMember.cs, XmlTextAttribute.cs, XmlTypeAttribute.cs:
	  Added InternalEquals method.
	* XmlAttributes.cs: Removed a lot of unused code. Added InternalEquals method.
	* SoapReflectionImporter.cs: Set SerializationSource to generated maps.
	* XmlCustomFormatter.cs: Fixed little bug.
	* XmlMapping.cs: Added Source property. This a global identifier of the map.
	* XmlReflectionImporter.cs: Set SerializationSource to generated maps.
	* XmlSchemaImporter.cs: Set the correct value for IsNillable when importing
	  mapping members.
	* XmlSerializationReaderInterpreter.cs, XmlSerializationWriter.cs: Minor fixes.
	* XmlSerializationWriterInterpreter.cs: WriteObject and WriteEnum were not
	  correctly used.
	* XmlSerializer.cs: Added support for generation of serializers.

svn path=/trunk/mcs/; revision=23392
2004-02-24 12:03:28 +00:00
Lluis Sanchez 247e8203ac * XmlSerializationReader.cs, XmlSerializationWriter.cs, XmlSerializer.cs:
Removed several TODOs already done.

svn path=/trunk/mcs/; revision=19893
2003-11-12 15:58:12 +00:00
Lluis Sanchez a9a47195a8 * XmlSerializer.cs, XmlSerializationWriter.cs: Fixed bug #49353
(XmlSerializer.Serialize() handles namespace parameter incorrectly)

svn path=/trunk/mcs/; revision=18755
2003-10-08 16:38:04 +00:00