Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
//
// AssemblyInfo.cs
//
// Author:
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Ximian, Inc. http://www.ximian.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Reflection;
using System.Resources;
using System.Security;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about the System.Runtime.Serialization.Formatters.Soap assembly
[assembly: AssemblyTitle ("System.Runtime.Serialization.Formatters.Soap.dll")]
[assembly: AssemblyDescription ("System.Runtime.Serialization.Formatters.Soap.dll")]
[assembly: AssemblyDefaultAlias ("System.Runtime.Serialization.Formatters.Soap.dll")]
[assembly: AssemblyCompany (Consts.MonoCompany)]
[assembly: AssemblyProduct (Consts.MonoProduct)]
[assembly: AssemblyCopyright (Consts.MonoCopyright)]
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
[assembly: AssemblyVersion (Consts.FxVersion)]
[assembly: SatelliteContractVersion (Consts.FxVersion)]
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: ComVisible (true)]
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]

View File

@@ -0,0 +1,15 @@
2008-04-23 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* AssemblyInfo.cs: Added missing attributes
2006-05-31 Gert Driesen <drieseng@users.sourceforge.net>
* AssemblyInfo.cs: Added assembly level attributes on 2.0 profile to
match those of MS.NET. Fixes few corcompare warnings. Set eol-style
to native.
2004-03-31 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* AssemblyInfo.cs: Added
* ChangeLog: Added
* Locale.cs: Added

View File

@@ -0,0 +1,107 @@
2007-10-11 Roei Erez <roeie@mainsoft.com>
* remove redundant call to 'Type.GetType'.
2006-10-29 Robert Jordan <robertj@gmx.net>
* added SerializationCallbackTest.cs. See bug #78594.
2006-04-04 roei erez <roeie@mainsoft.com>
* added InternalSoapValuesTest.cs to Tests sources
* SoapReader.cs: bug 77563 competability with MS.NET in
serializing/deserializing internal soap types (Decimal, DateTime ...)
2005-11-16 Vladislav Spivak <spivak@mainsoft.com>
* Added net_1_1_java source includes
2005-10-30 Svetlana Zholkovsky <svetlanaz@mainsoft.com>
* Add Mainsoft's files System.Runtime.Serialization.Formatters.Soap.vmwcsproj and
System.Runtime.Serialization.Formatters.Soap.sln to the svn
* Add some TARGET_JVM conditions to the AssemblyInfo.cs
* Fix SoapTypeMapper.cs:
- MethodSignature.ReadXmlValue method to return empty Type array instead of null.
- SoapTypeMapper.GetXmlElement method to exclude '&' from the encoded string.
2004-09-14 Raja R Harinath <rharinath@novell.com>
* Makefile (EXTRA_DISTFILES): Remove Soap.cmbx.
2004-05-06 Jean-Marc Andre <jeanmarc.andre@cpe.fr>
* SoapTypeMapper.cs:
Small fix about string type information not correctly formatted.
2004-04-15 Jean-Marc Andre <jeanmarc.andre@cpe.fr>
* SoapFormatter.cs, SoapReader.cs, SoapWriter.cs, SoapTypeMapper.cs:
Rewrote almost completly to make the code easier to understand
and maintain.
AssemblyFormat and TypeFormat are now implemented.
* SoapParser.cs, ObjectReader.cs, ObjectWriter.cs, SoapCommon.cs,
ISoapParser.cs, ISoapReader.cs, ISoapWriter.cs:
Removed for the same reasons as above.
* SerializationTest.cs:
New unit test inspired by the one developped by Lluis Sanchez
for the BinaryFormatter.
2004-03-31 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* System.Runtime.Serialization.Formatters.Soap.dll.sources:
Added new AssemblyInfo, removed old one, added Locale.cs
* Makefile: Removed unused ref
2004-02-19 Jean-Marc Andre <jeanmarc.andre@cpe.fr>
* SoapFormatter.cs:
Forced the utilisation of CultureInfo("en-US") during
the serialization and deserialization because I got problems
with numeral and date format.
* SoapWriter.cs, SoapCommon.cs:
Bug fixed: XmlTextWriter.WriteAttributeString() was used
with its "namespace" parameter set to null whereas it shouldn't.
2003-12-22 Jean-Marc Andre <jeanmarc.andre@cpe.fr>
* SoapFormatterTest.cs:
Added unit test for the SerializationBinder property
2003-11-21 Jean-Marc Andre <jeanmarc.andre@cpe.fr>
* SoapReader.cs:
Bug fixed. SerializationBinder.BindToType wasn't called
the right way in GetElementInfo() (switched assemblyName and
typeName parameters).
2003-08-25 Lluis Sanchez Gual <lluis@ximian.com>
* SoapTypeMapper.cs: Added mappings for more primitive types.
* SoapWriter.cs: Use XmlSchema.Namespace and XmlSchema.InstanceNamespace
instead of string constants.
2003-06-30 Jean-Marc Andre <jean-marc.andre@polymtl.ca>
* SoapServices:
removed because it is now included in the
right assembly.
* SoapFormatter.cs, SoapWriter.cs, ObjectWriter.cs:
cleaned the code
2003-05-27 Jean-Marc Andre <jean-marc.andre@polymtl.ca>
* SoapWriter:
bugs fixed
* SoapFormatter:
preparing for the remoting
2003-05-15 Jean-Marc Andre <jean-marc.andre@polymtl.ca>
* SoapFormatter:
New version of the SoapFormatter installed
* list.unix:
added to build the new formatter
* makefile.gnu:
changed to build the new formatter
* System.Runtime.Serialization.Formatters.Soap:
many files added or change to build the new formatter
* Test:
nunit-2 test added
2002-08-15 Tim Coleman <tim@timcoleman.com>
* ChangeLog:
New changelog added
* list:
* makefile.gnu:
Added so we can build this assembly on linux now.

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<masterdoc assembly="System.Runtime.Serialization.Formatters.Soap">
<class name="SoapFormatter" namespace="System.Runtime.Serialization.Formatters.Soap">
<constructor name="SoapFormatter" argnames="" />
<constructor name="SoapFormatter(System.Runtime.Serialization.ISurrogateSelector, System.Runtime.Serialization.StreamingContext)" argnames="selector, context" />
<property name="TopObject" propertytype="System.Runtime.Serialization.Formatters.ISoapMessage" />
<property name="TypeFormat" propertytype="System.Runtime.Serialization.Formatters.FormatterTypeStyle" />
<property name="AssemblyFormat" propertytype="System.Runtime.Serialization.Formatters.FormatterAssemblyStyle" />
<property name="SurrogateSelector" propertytype="System.Runtime.Serialization.ISurrogateSelector" />
<property name="Binder" propertytype="System.Runtime.Serialization.SerializationBinder" />
<property name="Context" propertytype="System.Runtime.Serialization.StreamingContext" />
<method name="Serialize(System.IO.Stream, System.Object)" argnames="serializationStream, graph" returntype="System.Void" />
<method name="Deserialize(System.IO.Stream)" argnames="serializationStream" returntype="System.Object" />
<method name="Serialize(System.IO.Stream, System.Object, System.Runtime.Remoting.Messaging.Header[])" argnames="serializationStream, graph, headers" returntype="System.Void" />
<method name="Deserialize(System.IO.Stream, System.Runtime.Remoting.Messaging.HeaderHandler)" argnames="serializationStream, handler" returntype="System.Object" />
<method name="Finalize" argnames="" inherited="System.Object" returntype="System.Void" />
<method name="GetHashCode" argnames="" inherited="System.Object" returntype="System.Int32" />
<method name="Equals(System.Object)" argnames="obj" inherited="System.Object" returntype="System.Boolean" />
<method name="ToString" argnames="" inherited="System.Object" returntype="System.String" />
<method name="GetType" argnames="" inherited="System.Object" returntype="System.Type" />
<method name="MemberwiseClone" argnames="" inherited="System.Object" returntype="System.Object" />
</class>
</masterdoc>

View File

@@ -0,0 +1,414 @@
<?xml version="1.0" encoding="utf-8"?>
<Type Name="SoapFormatter" FullName="System.Runtime.Serialization.Formatters.Soap.SoapFormatter">
<TypeSignature Language="C#" Value="public sealed class SoapFormatter : System.Runtime.Remoting.Messaging.IRemotingFormatter" />
<AssemblyInfo>
<AssemblyName>System.Runtime.Serialization.Formatters.Soap</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Runtime.Remoting.Messaging.IRemotingFormatter</InterfaceName>
</Interface>
</Interfaces>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<block subset="none" type="note">
<para>Beginning with the .NET Framework 2.0, this class is obsolete. Use <see cref="T:System.Runtime.Serialization.Formatters.Binary.BinaryFormatter" /> instead.</para>
</block>
<para>The <see cref="T:System.Runtime.Serialization.Formatters.Soap.SoapFormatter" /> and <see cref="T:System.Runtime.Serialization.Formatters.Binary.BinaryFormatter" /> classes implement the <see cref="T:System.Runtime.Remoting.Messaging.IRemotingFormatter" /> interface to support remote procedure calls (RPCs), and the <see cref="T:System.Runtime.Serialization.IFormatter" /> interface (inherited by the <see cref="T:System.Runtime.Remoting.Messaging.IRemotingFormatter" />) to support serialization of a graph of objects. The <see cref="T:System.Runtime.Serialization.Formatters.Soap.SoapFormatter" /> class also supports RPCs with <see cref="T:System.Runtime.Serialization.Formatters.ISoapMessage" /> objects, without using the <see cref="T:System.Runtime.Remoting.Messaging.IRemotingFormatter" /> functionality.</para>
<para>During RPCs, the <see cref="T:System.Runtime.Remoting.Messaging.IRemotingFormatter" /> interface allows the specification of two separate object graphs: the graph of objects to serialize, and an additional graph that contains an array of header objects that convey information about the remote function call (for example, transaction ID or a method signature). For proper serialization, the root object of the first graph must be an object that implements either the <see cref="T:System.Runtime.Remoting.Messaging.IMethodCallMessage" /> interface or the <see cref="T:System.Runtime.Remoting.Messaging.IMethodReturnMessage" /> interface.</para>
<para>During deserialization of an RPC, a <see cref="T:System.Runtime.Remoting.Messaging.HeaderHandler" /> delegate is specified to the <see cref="M:System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(System.IO.Stream)" /> method of the formatter. The remoting infrastructure uses the <see cref="T:System.Runtime.Remoting.Messaging.HeaderHandler" /> delegate to produce an object that supports the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface. This object contains the information stored in the headers, and becomes the root of the graph returned by the deserializer.</para>
<para>The <see cref="T:System.Runtime.Serialization.Formatters.Soap.SoapFormatter" /> can also handle RPCs that are produced with objects that implement the <see cref="T:System.Runtime.Serialization.Formatters.ISoapMessage" /> interface. To create an RPC without using the <see cref="T:System.Runtime.Remoting.Messaging.IRemotingFormatter" /> functionality, place an object that supports the <see cref="T:System.Runtime.Serialization.Formatters.ISoapMessage" /> interface at the root of a graph being serialized. To deserialize an RPC created in this manner the <see cref="P:System.Runtime.Serialization.Formatters.Soap.SoapFormatter.TopObject" /> property must be set to another object that supports the <see cref="T:System.Runtime.Serialization.Formatters.ISoapMessage" /> interface, and contains the relevant remote call information.</para>
<format type="text/html">
<h2>TimeSpan Serialization</h2>
</format>
<para>TimeSpan objects are serialized according to the ISO 8601: 1998 section 5.5.3.2.1 "Alternative" standard. </para>
<format type="text/html">
<h2>Version Information</h2>
</format>
<para>The <see cref="T:System.Runtime.Serialization.Formatters.Soap.SoapFormatter" /> does not support serialization compatibility between versions of the .NET Framework. Serialization between versions 1.1 and 2.0 types in the Framework often fails. The following actions can be taken to remedy this issue:</para>
<list type="bullet">
<item>
<para>Convert to use the <see cref="T:System.Runtime.Serialization.Formatters.Binary.BinaryFormatter" />, which provides compatibility between 1.1 and 2.0.</para>
</item>
<item>
<para>Convert existing persisted data to the new format.</para>
</item>
<item>
<para>Convert all producers and consumers of serialized data to version 2.0.</para>
</item>
<item>
<para>Avoid using types that changed from 1.1 to 2.0.</para>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Serializes and deserializes an object, or an entire graph of connected objects, in SOAP format.</para>
</summary>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SoapFormatter ();" />
<MemberType>Constructor</MemberType>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The following table shows the initial property values for an instance of <see cref="T:System.Runtime.Serialization.Formatters.Soap.SoapFormatter" />.</para>
<list type="table">
<listheader>
<item>
<term>
<para>Property </para>
</term>
<description>
<para>Value </para>
</description>
</item>
</listheader>
<item>
<term>
<para>
<see cref="P:System.Runtime.Serialization.Formatters.Soap.SoapFormatter.SurrogateSelector" /> </para>
</term>
<description>
<para>null</para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Context" /> </para>
</term>
<description>
<para>A new <see cref="T:System.Runtime.Serialization.StreamingContext" /> initialized to specify that the serialized data can be transmitted to or received from any of the other contexts</para>
</description>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Runtime.Serialization.Formatters.Soap.SoapFormatter" /> class with default property values.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SoapFormatter (System.Runtime.Serialization.ISurrogateSelector selector, System.Runtime.Serialization.StreamingContext context);" />
<MemberType>Constructor</MemberType>
<Parameters>
<Parameter Name="selector" Type="System.Runtime.Serialization.ISurrogateSelector" />
<Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Objects are serialized to, or deserialized from, the specified <see cref="T:System.IO.Stream" />.</para>
<para>The serialization or deserialization process uses the specified <see cref="T:System.Runtime.Serialization.ISurrogateSelector" /> to search for surrogates that are registered for the object types you want to deserialize. Surrogates are helpers that serialize and deserialize objects of specific classes. The default <see cref="T:System.Runtime.Serialization.ISurrogateSelector" /> cannot handle the serialization of objects that derive from the <see cref="T:System.MarshalByRefObject" /> for remoting purposes. In a remoting situation the specified <see cref="T:System.Runtime.Serialization.ISurrogateSelector" /> replaces the object derived from <see cref="T:System.MarshalByRefObject" /> with a <see cref="T:System.Runtime.Remoting.ObjRef" /> object that is serialized by the specified surrogate selector. Therefore, if you want to use remote objects, set the <paramref name="selector" /> parameter to an instance of <see cref="T:System.Runtime.Remoting.Messaging.RemotingSurrogateSelector" />. If you do not need surrogates, set the <paramref name="selector" /> parameter to be null.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Runtime.Serialization.Formatters.Soap.SoapFormatter" /> class with the specified <see cref="T:System.Runtime.Serialization.ISurrogateSelector" /> and <see cref="T:System.Runtime.Serialization.StreamingContext" />.</para>
</summary>
<param name="selector">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Runtime.Serialization.ISurrogateSelector" /> to use with the new instance of <see cref="T:System.Runtime.Serialization.Formatters.Soap.SoapFormatter" />. Can be null. </param>
<param name="context">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that holds the source and destination of the serialization. If the <paramref name="context" /> parameter is null, then the <see cref="P:System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Context" /> defaults to <see cref="F:System.Runtime.Serialization.StreamingContextStates.CrossMachine" />. </param>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="AssemblyFormat">
<MemberSignature Language="C#" Value="public System.Runtime.Serialization.Formatters.FormatterAssemblyStyle AssemblyFormat { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Runtime.Serialization.Formatters.FormatterAssemblyStyle</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the behavior of the deserializer with regards to finding and loading assemblies.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Binder">
<MemberSignature Language="C#" Value="public System.Runtime.Serialization.SerializationBinder Binder { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Runtime.Serialization.SerializationBinder</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the <see cref="T:System.Runtime.Serialization.SerializationBinder" /> that controls the binding of a serialized object to a type.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Context">
<MemberSignature Language="C#" Value="public System.Runtime.Serialization.StreamingContext Context { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Runtime.Serialization.StreamingContext</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="T:System.Runtime.Serialization.StreamingContext" /> provides an enumeration that describes the source and the destination for a given serialized stream, as well as a way for serialization to retain that context and an additional caller-defined context.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the <see cref="T:System.Runtime.Serialization.StreamingContext" /> used with this <see cref="T:System.Runtime.Serialization.Formatters.Soap.SoapFormatter" />.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Deserialize">
<MemberSignature Language="C#" Value="public object Deserialize (System.IO.Stream serializationStream);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="serializationStream" Type="System.IO.Stream" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>For successful deserialization, the current position in the stream must be at the beginning of the object graph.</para>
<block subset="none" type="note">
<para>Calling this method with untrusted data is a security risk. Call this method only with trusted data. For more information, see <see cref="http://go.microsoft.com/fwlink/?LinkId=330378">Untrusted Data Security Risks</see>.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Deserializes the data on the provided stream and reconstitutes the graph of objects.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The top object of the deserialized graph (root).</para>
</returns>
<param name="serializationStream">
<attribution license="cc4" from="Microsoft" modified="false" />The stream that contains the data to deserialize. </param>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Deserialize">
<MemberSignature Language="C#" Value="public object Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="serializationStream" Type="System.IO.Stream" />
<Parameter Name="handler" Type="System.Runtime.Remoting.Messaging.HeaderHandler" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Headers are used only for specific remoting applications. The <see cref="T:System.Runtime.Remoting.Messaging.HeaderHandler" /> parameter is one of two ways to return headers from a stream in SOAP Remote Procedure Call (RPC) format. The other way is to use the <see cref="P:System.Runtime.Serialization.Formatters.Soap.SoapFormatter.TopObject" /> property.</para>
<para>For successful deserialization, the current position in the stream must be at the beginning of the object graph.</para>
<format type="text/html">
<h2>TimeSpan Serialization</h2>
</format>
<para>TimeSpan objects are serialized according to the ISO 8601: 1998 section 5.5.3.2.1 "Alternative" standard.</para>
<block subset="none" type="note">
<para>Calling this method with untrusted data is a security risk. Call this method only with trusted data. For more information, see <see cref="http://go.microsoft.com/fwlink/?LinkId=330378">Untrusted Data Security Risks</see>.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Deserializes the stream into an object graph with any headers in that stream being handled by the given <see cref="T:System.Runtime.Remoting.Messaging.HeaderHandler" />.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The top object of the deserialized graph (root).</para>
</returns>
<param name="serializationStream">
<attribution license="cc4" from="Microsoft" modified="false" />The stream that contains the data to deserialize.</param>
<param name="handler">
<attribution license="cc4" from="Microsoft" modified="false" />Delegate to handle any headers found on the stream. Can be null. </param>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="FilterLevel">
<MemberSignature Language="C#" Value="public System.Runtime.Serialization.Formatters.TypeFilterLevel FilterLevel { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Runtime.Serialization.Formatters.TypeFilterLevel</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Supported values are <see cref="F:System.Runtime.Serialization.Formatters.TypeFilterLevel.Low" /> and <see cref="F:System.Runtime.Serialization.Formatters.TypeFilterLevel.Full" /> (the default). For details about deserialization levels, see <format type="text/html"><a href="313a0e88-5b2b-4a17-8391-0ddf9f7a787b">Automatic Deserialization in .NET Remoting</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the <see cref="T:System.Runtime.Serialization.Formatters.TypeFilterLevel" /> of automatic deserialization for .NET Framework remoting.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Serialize">
<MemberSignature Language="C#" Value="public void Serialize (System.IO.Stream serializationStream, object graph);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="serializationStream" Type="System.IO.Stream" />
<Parameter Name="graph" Type="System.Object" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>TimeSpan objects are serialized according to the ISO 8601: 1998 section 5.5.3.2.1 "Alternative" standard.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Serializes an object or graph of objects with the specified root to the given <see cref="T:System.IO.Stream" />.</para>
</summary>
<param name="serializationStream">
<attribution license="cc4" from="Microsoft" modified="false" />The stream onto which the formatter puts the data to serialize. </param>
<param name="graph">
<attribution license="cc4" from="Microsoft" modified="false" />The object, or root of the object graph, to serialize. All child objects of this root object are automatically serialized. </param>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Serialize">
<MemberSignature Language="C#" Value="public void Serialize (System.IO.Stream serializationStream, object graph, System.Runtime.Remoting.Messaging.Header[] headers);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="serializationStream" Type="System.IO.Stream" />
<Parameter Name="graph" Type="System.Object" />
<Parameter Name="headers" Type="System.Runtime.Remoting.Messaging.Header[]" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Headers are used only for specific remoting applications.</para>
<para>TimeSpan objects are serialized according to the ISO 8601: 1998 section 5.5.3.2.1 "Alternative" standard.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Serializes an object or graph of objects with the specified root to the given <see cref="T:System.IO.Stream" /> in the SOAP Remote Procedure Call (RPC) format.</para>
</summary>
<param name="serializationStream">
<attribution license="cc4" from="Microsoft" modified="false" />The stream onto which the formatter puts the data to serialize. </param>
<param name="graph">
<attribution license="cc4" from="Microsoft" modified="false" />The object or root of the object graph to serialize. All child objects of this root object are automatically serialized. </param>
<param name="headers">
<attribution license="cc4" from="Microsoft" modified="false" />Remoting headers to include in the serialization. Can be null. </param>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="SurrogateSelector">
<MemberSignature Language="C#" Value="public System.Runtime.Serialization.ISurrogateSelector SurrogateSelector { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Runtime.Serialization.ISurrogateSelector</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Used by <see cref="N:System.Runtime.Remoting" /> to generate <see cref="T:System.Runtime.Remoting.ObjRef" /> instances for <see cref="T:System.MarshalByRefObject" /> objects.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the <see cref="T:System.Runtime.Serialization.SurrogateSelector" /> that controls type substitution during serialization and deserialization.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="TopObject">
<MemberSignature Language="C#" Value="public System.Runtime.Serialization.Formatters.ISoapMessage TopObject { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Runtime.Serialization.Formatters.ISoapMessage</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This property is used for SOAP remote procedure call (RPC) format and specifies that the SOAP top record is a method called remotely, not a common language runtime object type.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the <see cref="T:System.Runtime.Serialization.Formatters.ISoapMessage" /> into which the SOAP top object is deserialized.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="TypeFormat">
<MemberSignature Language="C#" Value="public System.Runtime.Serialization.Formatters.FormatterTypeStyle TypeFormat { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Runtime.Serialization.Formatters.FormatterTypeStyle</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the format in which type descriptions are laid out in the serialized stream.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
</Members>
</Type>

View File

@@ -0,0 +1,64 @@
<Overview>
<Assemblies>
<Assembly Name="System.Runtime.Serialization.Formatters.Soap" Version="2.0.0.0">
<Attributes>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(System.Runtime.CompilerServices.CompilationRelaxations.NoStringInterning)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyFileVersion("2.0.50727.1433")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.CLSCompliant(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ComCompatibleVersion(1, 0, 3300, 0)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Resources.NeutralResourcesLanguage("en-US")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Resources.SatelliteContractVersion("2.0.0.0")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyInformationalVersion("2.0.50727.1433")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyCopyright("(c) various MONO Authors")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyProduct("MONO Common language infrastructure")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyCompany("MONO development team")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyDefaultAlias("System.Runtime.Serialization.Formatters.Soap.dll")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyDescription("System.Runtime.Serialization.Formatters.Soap.dll")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyTitle("System.Runtime.Serialization.Formatters.Soap.dll")</AttributeName>
</Attribute>
</Attributes>
</Assembly>
</Assemblies>
<Remarks>To be added.</Remarks>
<Copyright>To be added.</Copyright>
<Types>
<Namespace Name="System.Runtime.Serialization.Formatters.Soap">
<Type Name="SoapFormatter" Kind="Class" />
</Namespace>
</Types>
<Title>System.Runtime.Serialization.Formatters.Soap</Title>
</Overview>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Namespace Name="System.Runtime.Serialization.Formatters.Soap">
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="N:System.Runtime.Serialization.Formatters.Soap" /> namespace contains the <see cref="T:System.Runtime.Serialization.Formatters.Soap.SoapFormatter" /> class, which can be used to serialize and deserialize objects in the SOAP format. When building applications that uses the types in this namespace, you must reference the System.Runtime.Serialization.Formatters.Soap.dll assembly.</para>
</summary>
</Docs>
</Namespace>

View File

@@ -0,0 +1,17 @@
thisdir = class/System.Runtime.Serialization.Formatters.Soap
SUBDIRS =
include ../../build/rules.make
# bet you can't say this ten times fast
LIBRARY = System.Runtime.Serialization.Formatters.Soap.dll
LIB_MCS_FLAGS = /r:$(corlib) /r:System.Xml.dll
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
EXTRA_DISTFILES = \
README \
Sample.txt \
Test/Test.cmbx \
Test/Test.prjx
include ../../build/library.make

View File

@@ -0,0 +1,17 @@
Build instruction:
extract the archive to the mcs/class/ dir
to build it on windows:
nant
to build it on linux:
make -f makefile.gnu install prefix=/pathtoyourmonoinstallationdir/
to run tests on windows:
nant test
to run tests on linux:
cd Test
make -f makefile.gnu test
If you want to use it with other applications, you have to reference it with "-r System.Runtime.Serialization.Formatters.Soap1.dll"

View File

@@ -0,0 +1,179 @@
namespace WindowsApplicationProve
{
namespace Cxxx
{
[Serializable]
public struct OtherStruct
{
public int FInt;
}
[Serializable]
public struct StructSample
{
public int FInt;
public char FChar;
public object FObj;
}
[Serializable]
public enum EnumSample
{
aa,
bb,
cc
}
[Serializable]
public delegate int DelegateProve(int i);
[Serializable]
public delegate void OtherDelegate();
public interface ISample
{
int FirstMethod(char charParam);
}
[Serializable]
public class cIntProve: ISample
{
public long FLongField;
public int FirstMethod(char charParam)
{
return 6;
}
}
public delegate string DlgProve(int i);
[Serializable]
public class cAgregationClass:BaseClass
{
public Char FCharField;
public string FStr;
public cSerializableProve Fobj;
public ISample Fintf;
//public int[][] FIntList;
public string DlgCatcher(int i)
{
return "Hello";
}
}
[Serializable]
public class BaseClass
{
public int FBaseint;
public cIntProve FIntObj;
}
[Serializable]
public class cXXX
{
public int FI;
}
[Serializable]
public class cSerializableProve
{
public object[] FArrayProve;
public object[] FNullArray;
//public ClassProve FOtherAssObj;
public cAgregationClass FAggField;
//value types
public DelegateProve FDelegateProve;
public event OtherDelegate FEventField;
public ISample FInterfaceField;
public string FStrField;
private int FPintField;
public int FIntField;
public uint FUintField;
public short FShortField;
public ushort FUShortField;
public long FLongField;
public ulong FULongField;
public bool FBoolField;
public double FDoubleField;
public decimal FDecimalField;
public char FCharField;
public StructSample FStructField;
public EnumSample FEnumField;
public cSerializableProve()
{
InitReferences();
InitSimpleTypes();
InitStructs();
InitArray();
}
private void InitReferences()
{
FAggField = new cAgregationClass();
FAggField.FCharField = 'a';
FAggField.FBaseint = 10;
FAggField.Fobj= this;
FAggField.FStr= "Hhhh";
FStrField= FAggField.FStr;
FAggField.FIntObj= new cIntProve ();
FInterfaceField= FAggField.FIntObj;
FAggField.Fintf= FInterfaceField;
}
private void InitSimpleTypes()
{
FArrayProve= new Object[20];
FPintField= 10;
FIntField = 6;
FUintField = 6;
FShortField = 6;
FUShortField = 6;
FLongField = 6;
FULongField = 6;
FDoubleField = 6;
FDecimalField = 5;
FBoolField = true;
FCharField = 'a';
FEnumField = EnumSample.aa;
}
private void InitStructs()
{
FStructField= new StructSample();
FStructField.FChar= 'a';
FStructField.FInt= 10;
FStructField.FObj= this.FAggField;
}
private void InitArray()
{
FArrayProve[0]= new cAgregationClass();
((cAgregationClass)FArrayProve[0]).FStr= "Hello";
FArrayProve[1]= new cAgregationClass[2];
((cAgregationClass[])FArrayProve[1])[0]= this.FAggField;
FArrayProve[2]= new int[][][]{new int[][]{new int[3], new int[3], new int[3]}, new int[][]{new int[3], new int[3], new int[3]}};
/*Fill the integer array*/
((int[][][])FArrayProve[2])[1][1][1]= 10;
((int[][][])FArrayProve[2])[1][1][2]= 10;
((int[][][])FArrayProve[2])[1][1][0]= 10;
FArrayProve[3]= new OtherStruct();
FArrayProve[4]= 6;
FArrayProve[5]= true;
FArrayProve[6]= 2.5;
FArrayProve[7]= EnumSample.bb;
FArrayProve[8]= this.FInterfaceField;
FArrayProve[9]= "Hello";
FArrayProve[10]= new UInt32();
FArrayProve[11]= new short();
FArrayProve[12]= new UInt16();
FArrayProve[13]= new decimal();
FArrayProve[15]= new ulong();
FArrayProve[16]= new char();
FArrayProve[18]= null;
}
public void InitDelegates()
{
FDelegateProve= new DelegateProve(SIntProve);
FEventField= new OtherDelegate(OtherProve);
}

View File

@@ -0,0 +1,8 @@
Assembly/AssemblyInfo.cs
../../build/common/Consts.cs
../../build/common/Locale.cs
System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
System.Runtime.Serialization.Formatters.Soap/SoapReader.cs
System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
System.Runtime.Serialization.Formatters.Soap/SoapFormatter.cs
../../build/common/MonoTODOAttribute.cs

View File

@@ -0,0 +1,159 @@
2006-10-29 Robert Jordan <robertj@gmx.net>
* SoapReader.cs, SoapWriter.cs [NET_2_0]:
Use the SerializationObjectManager.
2006-07-10 Lluis Sanchez Gual <lluis@novell.com>
* SoapReader.cs: Register strings in the object manager.
Fixes bug #78696.
2006-05-31 Gert Driesen <drieseng@users.sourceforge.net>
* SoapFormatter.cs: Only apply ComVisible attribute to FilterLevel
on 1.0 profile.
2006-05-31 Gert Driesen <drieseng@users.sourceforge.net>
* SoapWriter.cs: Fixed line endings. Set eol-style to CRLF.
* SoapReader.cs: Fixed line endings. Set eol-style to CRLF.
* SoapFormatter.cs: Fixed line endings. Set eol-style to CRLF.
Remove unnecessary dtor.
* SoapTypeMapper.cs: Fixed line endings. Set eol-style to native.
2006-04-04 roei erez <roeie@mainsoft.com>
*SoapReader.cs: bug 77563 competability with MS.NET in
serializing/deserializing internal soap types (Decimal, DateTime ...)
2005-09-21 Lluis Sanchez Gual <lluis@novell.com>
* SoapWriter.cs, SoapReader.cs: Encode/Decode field names when
serializing/deserializing an object using custom serialization.
Fixes bug #75970.
2005-07-29 Lluis Sanchez Gual <lluis@novell.com>
* SoapWriter.cs: Wrap method signature headers in a MethodSignature
object before serializing. Track changes in SoapTypeMapper.
* SoapReader.cs: Track changes in SoapTypeMapper. Factorized some code.
* SoapTypeMapper.cs: Replaced indexers by regular methods, this makes
code easier to read an understand. Simplified the code for registering
basic soap types. Added support for types from
System.Runtime.Remoting.Metadata.W3cXsd2001. Implemented support
for MethodSignature serialization. All this fixes bug #75537.
2005-07-14 Lluis Sanchez Gual <lluis@novell.com>
* SoapReader.cs: Fixed parsing of array dimensions. Patch by Roei Erez
for bug #75536.
* SoapTypeMapper.cs: When encoding the name of a type, if the type is
an array don't encode the array dimensions.
2005-06-27 Lluis Sanchez Gual <lluis@novell.com>
* SoapWriter.cs: Serialize TimeSpan values like MS.NET. Fix by Roei Erez
for bug #75364.
2005-05-10 Lluis Sanchez Gual <lluis@novell.com>
* SoapTypeMapper.cs: Serialize floats and doubles using the correct
precision. Patch by Roei Erez that fixes bug #75196.
2005-05-09 Lluis Sanchez Gual <lluis@novell.com>
* SoapReader.cs:
* SoapWriter.cs: Use InternalRemotingServices.GetCachedSoapAttribute to
get the name of the fields being serialized. Fixed some warnings.
2005-05-05 Lluis Sanchez Gual <lluis@novell.com>
* SoapTypeMapper.cs: Added missing maps for primitive types and
fixed bool conversion to string. This patch by Luke Ravitch
fixes bug #74295.
2005-02-10 Lluis Sanchez Gual <lluis@novell.com>
* SoapFormatter.cs: Don't store the SoapWriter in an instance field,
it is not needed and it is not thread safe. This fixes bug #72344.
2005-02-10 Lluis Sanchez Gual <lluis@novell.com>
* SoapReader.cs: Don't crash if the xml has more fields than expected.
2004-09-13 Lluis Sanchez Gual <lluis@ximian.com>
* SoapReader.cs: Handle SOAP invocation without arguments in SoapReader.
Patch by Stefan Paletta.
2004-08-24 Lluis Sanchez Gual <lluis@ximian.com>
* SoapReader.cs: Serialize byte arrays using base64 encoding.
GetComponentType should always return the type if
specified, GetId can now be !=0 for base64 arrrays.
* SoapTypeMapper.cs: Register byte[] as base64 xml type.
* SoapWriter.cs: Handle base64 encoded byte arrays.
2004-06-10 Lluis Sanchez Gual <lluis@ximian.com>
* SoapWriter.cs: In SerializeArray, consider 1 a valid id.
2004-05-26 Lluis Sanchez Gual <lluis@ximian.com>
* SoapFormatter.cs: Added headers parameter to SoapWriter call.
* SoapReader.cs: Added support for deserialization of headers. Cache
both member indexes and member infos in the new TypeMetadata structure.
* SoapWriter.cs: Added support for serialization of headers.
2004-05-10 Gert Driesen (drieseng@users.sourceforge.net)
* SoapFormatter.cs: sealed class and added ComVisible attribute
to FilterLevel property to match MS.NET
* SoapTypeMapper.cs: fixed compiler warnings
2004-05-07 Lluis Sanchez Gual <lluis@ximian.com>
* SoapWriter.cs: Fixed string formatting.
2004-04-30 Lluis Sanchez Gual <lluis@ximian.com>
* SoapReader.cs: If the SoapMessage instance being filled includes the
array of parameter types, use those to deserialize the parameter values.
Use the new method SoapTypeMapper.ParseXsdValue() to parse primitive values.
* SoapTypeMapper.cs: Added GetXsdValue and ParseXsdValue.
* SoapWriter.cs: Always include parameter types when serializing a message.
MS.NET does it.
2003-03-18 David Sheldon <dave-mono@earth.li>
* SoapTypeMapper.cs: Map object to xsd:anyType rather than
SOAP-ENC:anyType so we can deserialise the objects serialised
by MS.NET.
2003-11-21 Lluis Sanchez Gual <lluis@ximian.com>
* SoapReader.cs: Little fix.
* SoapWriter.cs: Use ObjectIDGenerator instead of a couple of Hashtable.
2003-11-21 Lluis Sanchez Gual <lluis@ximian.com>
* SoapFormatter.cs: Added FilterLevel property.
2003-11-16 Lluis Sanchez Gual <lluis@ximian.com>
* SoapFormatter.cs: Added AssemblyFormat property.
2003-11-13 Lluis Sanchez Gual <lluis@ximian.com>
* ObjectWriter.cs: Added FIXME
* SoapParser.cs: Added null reference check.
2002-08-15 Tim Coleman <tim@timcoleman.com>
* SoapFormatter.cs:
That should be IRemotingFormatter, not IRemoteFormatter.
Some stubs to make it compile on linux.
* TODOAttribute.cs:
Added this class to this assembly.
2002-07-23 Duncan Mak <duncan@ximian.com>
* SoapFormatter.cs: This implements IFormatter and IRemoteFormatter.

View File

@@ -0,0 +1,161 @@
// created on 07/04/2003 at 17:16
//
// System.Runtime.Serialization.Formatters.Soap.SoapFormatter
//
// Authors:
// Jean-Marc Andre (jean-marc.andre@polymtl.ca)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Remoting;
using System.Runtime.Serialization;
using System.Runtime.Remoting.Messaging;
using System.Xml.Serialization;
using System.Threading;
using System.Globalization;
namespace System.Runtime.Serialization.Formatters.Soap {
enum RemMessageType {
MethodCall, MethodResponse, ServerFault, NotRecognize
}
public sealed class SoapFormatter: IRemotingFormatter, IFormatter {
private SerializationBinder _binder;
private StreamingContext _context;
private ISurrogateSelector _selector;
private FormatterAssemblyStyle _assemblyFormat = FormatterAssemblyStyle.Full;
private FormatterTypeStyle _typeFormat = FormatterTypeStyle.TypesWhenNeeded;
private ISoapMessage _topObject = null;
TypeFilterLevel _filterLevel = TypeFilterLevel.Low;
public SoapFormatter() {
_selector = null;
_context = new StreamingContext(StreamingContextStates.All);
}
public SoapFormatter(ISurrogateSelector selector, StreamingContext context) {
_selector = selector;
_context = context;
}
public object Deserialize(Stream serializationStream) {
return Deserialize(serializationStream, null);
}
public object Deserialize(Stream serializationStream, HeaderHandler handler) {
SoapReader soapReader = new SoapReader(_binder, _selector, _context);
return soapReader.Deserialize(serializationStream, _topObject);
}
public void Serialize(Stream serializationStream, object graph) {
Serialize(serializationStream, graph, null);
}
public void Serialize(Stream serializationStream, object graph, Header[] headers) {
if(serializationStream == null)
throw new ArgumentNullException("serializationStream");
if(!serializationStream.CanWrite)
throw new SerializationException("Can't write in the serialization stream");
if(graph == null)
throw new ArgumentNullException("graph");
SoapWriter soapWriter = new SoapWriter(serializationStream, _selector, _context, _topObject);
soapWriter.Serialize (graph, headers, _typeFormat, _assemblyFormat);
}
public ISurrogateSelector SurrogateSelector {
get {
return _selector;
}
set {
_selector = value;
}
}
public SerializationBinder Binder {
get {
return _binder;
}
set {
_binder = value;
}
}
public StreamingContext Context {
get {
return _context;
}
set {
_context = value;
}
}
public ISoapMessage TopObject {
get {
return _topObject;
}
set {
_topObject = value;
}
}
[MonoTODO ("Interpret this")]
public TypeFilterLevel FilterLevel {
get {
return _filterLevel;
}
set {
_filterLevel = value;
}
}
public FormatterAssemblyStyle AssemblyFormat
{
get {
return _assemblyFormat;
}
set {
_assemblyFormat = value;
}
}
public FormatterTypeStyle TypeFormat
{
get
{
return _typeFormat;
}
set
{
_typeFormat = value;
}
}
}
}

View File

@@ -0,0 +1,5 @@
AssemblyInfo.cs
SoapFormatterTest.cs
SerializationTest.cs
SerializationCallbackTest.cs
InternalSoapValuesTest.cs

View File

@@ -0,0 +1,32 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]
// The following attributes specify the key for the sign of your assembly. See the
// .NET Framework documentation for more information about signing.
// This is not required, if you don't want signing let these attributes like they're.
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]

View File

@@ -0,0 +1,92 @@
using System;
using System.IO;
using NUnit.Framework;
using System.Runtime.Serialization.Formatters.Soap;
namespace SoapShared
{
/// <summary>
/// Summary description for InternalSoapValuesTest.
/// </summary>
[TestFixture]
public class InternalSoapValuesTest
{
private MemoryStream ms;
private SoapFormatter sf;
public InternalSoapValuesTest()
{
ms = new MemoryStream();
sf = new SoapFormatter();
}
[Test]
public void WriteReadData()
{
SerializedClass c = new SerializedClass();
SerializeDeserialize(c);
SerializeDeserialize(new SerializedClass[]{c,c});
SerializeDeserialize(c.str);
SerializeDeserialize(c.m_bool);
SerializeDeserialize(c.m_byte);
SerializeDeserialize(c.m_bytes);
SerializeDeserialize(c.m_decimal);
SerializeDeserialize(c.m_double);
SerializeDeserialize(c.m_float);
SerializeDeserialize(c.m_int);
SerializeDeserialize(c.m_long);
SerializeDeserialize(c.m_object);
SerializeDeserialize(c.m_sbyte);
SerializeDeserialize(c.m_short);
SerializeDeserialize(c.m_time);
SerializeDeserialize(c.m_timeSpan);
SerializeDeserialize(c.m_uint);
SerializeDeserialize(c.m_ulong);
SerializeDeserialize(c.m_ushort);
}
private void SerializeDeserialize(object obj)
{
ms = new MemoryStream();
Serialize(obj, ms);
ms.Position = 0;
Object des = Deserialize(ms);
Assertion.AssertEquals(obj.GetType(), des.GetType());
}
private void Serialize(object ob, Stream stream)
{
sf.Serialize(stream, ob);
}
private object Deserialize(Stream stream)
{
Object obj = sf.Deserialize(stream);
return obj;
}
}
[Serializable]
class SerializedClass
{
public string str = "rrr";
public bool m_bool;
public sbyte m_sbyte;
public byte m_byte;
public long m_long;
public ulong m_ulong;
public int m_int;
public uint m_uint;
public float m_float;
public double m_double;
public decimal m_decimal;
public short m_short;
public ushort m_ushort;
public object m_object = new object();
public TimeSpan m_timeSpan = TimeSpan.FromTicks(TimeSpan.TicksPerDay);
public byte[] m_bytes = new byte[10];
public DateTime m_time = DateTime.Now;
}
}

View File

@@ -0,0 +1,241 @@
//
// System.Runtime.Serialization.Formatters.Soap.SerializationCallbackTest.cs
//
// Author: Robert Jordan (robertj@gmx.net)
//
#if NET_2_0
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Soap;
using System.Text;
using NUnit.Framework;
namespace MonoTests.System.Runtime.Serialization.Formatters.Soap
{
[TestFixture]
public class SerializationCallbackTest
{
[Test]
public void Test ()
{
Log.Clear ();
Driver (new SoapFormatter (), new A (new B()));
Console.WriteLine (Log.Text);
Assert.AreEqual (Log.Text, "A1B1A2B2A3B3B4A4");
}
[Test]
public void TestInheritance ()
{
Log.Clear ();
Driver (new SoapFormatter (), new C (new B()));
Console.WriteLine (Log.Text);
Assert.AreEqual (Log.Text, "A1C1B1A2C2B2A3B3B4A4");
}
[Test]
public void TestISerializable ()
{
Log.Clear ();
Driver (new SoapFormatter (), new A (new D()));
Console.WriteLine (Log.Text);
Assert.AreEqual (Log.Text, "A1B1A2B2A3B3B4A4");
}
void Driver (IFormatter formatter, A a)
{
MemoryStream stream = new MemoryStream();
formatter.Serialize(stream, a);
stream.Position = 0;
a.CheckSerializationStatus ();
a = (A) formatter.Deserialize (stream);
a.CheckDeserializationStatus ();
}
}
class Log
{
static StringBuilder b = new StringBuilder ();
public static void Write (string msg)
{
b.Append (msg);
}
public static void Clear ()
{
b = new StringBuilder ();
}
public static string Text {
get { return b.ToString (); }
}
}
[Serializable]
class A : IDeserializationCallback
{
public int Status = 0;
B inner;
public A (B inner)
{
this.inner = inner;
this.inner.Outer = this;
}
public void CheckSerializationStatus ()
{
Assert.AreEqual (2, Status, "#A01");
}
public void CheckDeserializationStatus ()
{
Assert.AreEqual (2, Status, "#A01");
}
[OnSerializing]
void OnSerializing (StreamingContext ctx)
{
Log.Write ("A1");
Assert.AreEqual (0, Status, "#A01");
Assert.AreEqual (0, inner.Status, "#A02");
Status++;
}
[OnSerialized]
void OnSerialized (StreamingContext ctx)
{
Log.Write ("A2");
Assert.AreEqual (1, Status, "#A03");
Assert.AreEqual (1, inner.Status, "#A04");
// must have no effect after deserialization
Status++;
}
[OnDeserializing]
void OnDeserializing (StreamingContext ctx)
{
Log.Write ("A3");
Assert.IsNull (inner, "#A05");
Assert.AreEqual(0, Status, "#A06");
// must have no effect after deserialization
Status = 42;
}
[OnDeserialized]
void OnDeserialized (StreamingContext ctx)
{
Log.Write ("A4");
Assert.IsNotNull (inner, "#A07");
Assert.AreEqual(1, Status, "#A08");
Assert.AreEqual(1, inner.Status, "#A10");
Status++;
}
void IDeserializationCallback.OnDeserialization (object sender)
{
// don't log the order because it's undefined
CheckDeserializationStatus ();
}
}
[Serializable]
class B : IDeserializationCallback
{
public int Status = 0;
public A Outer;
[OnSerializing]
void OnSerializing (StreamingContext ctx)
{
Log.Write ("B1");
Assert.AreEqual (0, Status, "#B01");
Assert.AreEqual (1, Outer.Status, "#B01.2");
Status++;
}
[OnSerialized]
void OnSerialized (StreamingContext ctx)
{
Log.Write ("B2");
Assert.AreEqual (1, Status, "#B02");
Assert.AreEqual (2, Outer.Status, "#B03");
// must have no effect after deserialization
Status++;
}
[OnDeserializing]
void OnDeserializing (StreamingContext ctx)
{
Log.Write ("B3");
Assert.IsNull (Outer, "#B05");
Assert.AreEqual (0, Status, "#B06");
// must have no effect after deserialization
Status = 42;
}
[OnDeserialized]
void OnDeserialized (StreamingContext ctx)
{
Log.Write ("B4");
}
void IDeserializationCallback.OnDeserialization (object sender)
{
// don't log the order because it's undefined
Assert.AreEqual (1, Status);
}
}
[Serializable]
class C : A
{
public C (B inner) : base (inner)
{
}
[OnSerializing]
void OnSerializing (StreamingContext ctx)
{
Log.Write ("C1");
Assert.AreEqual (1, Status, "#C01");
}
[OnSerialized]
void OnSerialized (StreamingContext ctx)
{
Log.Write ("C2");
Assert.AreEqual (2, Status, "#C02");
}
}
[Serializable]
class D : B, ISerializable
{
public D ()
{
}
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext ctx)
{
info.AddValue ("Status", Status);
info.AddValue ("Outer", Outer);
}
D (SerializationInfo info, StreamingContext ctx)
{
Status = info.GetInt32 ("Status");
Outer = (A) info.GetValue ("Outer", typeof (A));
}
}
}
#endif

Some files were not shown because too many files have changed in this diff Show More