System.Runtime.Remoting.SoapServices Class

Assembly: Mscorlib.dll
Namespace: System.Runtime.Remoting
Summary
Provides several methods for using and publishing remoted objects in SOAP format.
C# Syntax:
public class SoapServices
See also:
System.Runtime.Remoting Namespace

System.Runtime.Remoting.SoapServices Member List:

Public Properties
XmlNsForClrType Read-only

Gets the XML namespace prefix for common language run-time types.
XmlNsForClrTypeWithAssembly Read-only

Gets the default XML namespace prefix that should be used for XML encoding of a common language run-time class that has an assembly, but no native namespace.
XmlNsForClrTypeWithNs Read-only

Gets the XML namespace prefix that should be used for XML encoding of a common language run-time class that is part of the mscorlib.dll file.
XmlNsForClrTypeWithNsAndAssembly Read-only

Gets the default XML namespace prefix that should be used for XML encoding of a common language run-time class that has both a common language run-time namespace and an assembly.
Public Methods
CodeXmlNamespaceForClrTypeNamespace Returns the common language run-time type namespace name from the provided namespace and assembly names.
DecodeXmlNamespaceForClrTypeNamespace Decodes the XML namespace and assembly names from the provided common language run-time namespace.
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetInteropFieldTypeAndNameFromXmlAttribute Retrieves field type from XML attribute name, namespace, and the Type of the containing object.
GetInteropFieldTypeAndNameFromXmlElement Retrieves the Type and name of a field from the provided XML element name, namespace, and the containing type.
GetInteropTypeFromXmlElement Retrieves the Type that should be used during deserialization of an unrecognized object type with the given XML element name and namespace.
GetInteropTypeFromXmlType Retrieves the object Type that should used be during deserialization of an unrecognized object type with the given XML type name and namespace.
GetSoapActionFromMethodBase Returns the SOAPAction value associated with the method specified in the given MethodBase.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
GetTypeAndMethodNameFromSoapAction Determines the type and method name of the method associated with the specified SOAPAction value.
GetXmlElementForInteropType Returns XML element information that should be used when serializing the given type.
GetXmlNamespaceForMethodCall Retrieves the XML namespace used during remote calls of the method specified in the given MethodBase.
GetXmlNamespaceForMethodResponse Retrieves the XML namespace used during the generation of responses to the remote call to the method specified in the given MethodBase.
GetXmlTypeForInteropType Returns XML type information that should be used when serializing the given Type.
IsClrTypeNamespace Returns a Boolean value indicating whether the specified namespace is native to the common language run-time.
IsSoapActionValidForMethodBase Determines if the specified SOAPAction is acceptable for a given MethodBase.
PreLoad Overloaded:
PreLoad(Assembly assembly)

Preloads every Type found in the specified Assembly from the information found in the SoapTypeAttributes (see SoapTypeAttribute) associated with the object types.
PreLoad Overloaded:
PreLoad(Type type)

Registers the given object Type based on values set in a SoapTypeAttribute on the type.
RegisterInteropXmlElement Associates the given XML element name and namespace with a run-time type that should be used for deserialization.
RegisterInteropXmlType Associates the given XML type name and namespace with the run-time type that should be used for deserialization.
RegisterSoapActionForMethodBase Overloaded:
RegisterSoapActionForMethodBase(MethodBase mb)

Associates the specified MethodBase with the SOAPAction cached with it.
RegisterSoapActionForMethodBase Overloaded:
RegisterSoapActionForMethodBase(MethodBase mb, string soapAction)

Associates the provided SOAPAction value with the given MethodBase for use in channel sinks.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Runtime.Remoting.SoapServices Member Details

Property: XmlNsForClrType (read-only)
Summary
Gets the XML namespace prefix for common language run-time types.
C# Syntax:
public static string XmlNsForClrType {get;}
Remarks
WSDL and SOAP protocols encode common language run-time classes into XML namespaces. The current property specifies the format for the XML namespaces. All XML namespaces for a common language run-time class start with the String that the current property returns.

Return to top


Property: XmlNsForClrTypeWithAssembly (read-only)
Summary
Gets the default XML namespace prefix that should be used for XML encoding of a common language run-time class that has an assembly, but no native namespace.
C# Syntax:
public static string XmlNsForClrTypeWithAssembly {get;}
Remarks
WSDL and SOAP protocols encode common language run-time classes into XML namespaces. The current property specifies the format for the XML namespaces. If a common language run-time class has an assembly but no namespace, the current property returns the default XML namespace that is used.

Return to top


Property: XmlNsForClrTypeWithNs (read-only)
Summary
Gets the XML namespace prefix that should be used for XML encoding of a common language run-time class that is part of the mscorlib.dll file.
C# Syntax:
public static string XmlNsForClrTypeWithNs {get;}
Remarks
WSDL and SOAP protocols encode common language run-time classes into XML namespaces. The current property specifies the format for the XML namespaces. If a common language run-time class is part of the mscorlib assembly, the XML namespace returned by the current property is used.

Return to top


Property: XmlNsForClrTypeWithNsAndAssembly (read-only)
Summary
Gets the default XML namespace prefix that should be used for XML encoding of a common language run-time class that has both a common language run-time namespace and an assembly.
C# Syntax:
public static string XmlNsForClrTypeWithNsAndAssembly {get;}
Remarks
WSDL and SOAP protocols encode common language run-time classes into XML namespaces. The current property specifies the format for the XML namespaces. If a common language run-time class has an assembly and a common language run-time namespace, the current property returns the default XML namespace that is used.

Return to top


Method: CodeXmlNamespaceForClrTypeNamespace(
   string typeNamespace,
   string assemblyName
)
Summary
Returns the common language run-time type namespace name from the provided namespace and assembly names.
C# Syntax:
public static string CodeXmlNamespaceForClrTypeNamespace(
   string typeNamespace,
   string assemblyName
);
Parameters:

typeNamespace

The namespace that is to be coded.

assemblyName

The name of the assembly that is to be coded.

Return Value:
The common language run-time type namespace name from the provided namespace and assembly names.
Exceptions
Exception Type Condition
ArgumentNullException The assemblyName and typeNamespace parameters are both either null or empty.
Remarks
The current method is used by the .NET Framework and the SoapSuds tool to create an XML namespace name for a common language run-time object type.

For more information on SoapSuds see .

Return to top


Method: DecodeXmlNamespaceForClrTypeNamespace(
   string inNamespace,
   out string typeNamespace,
   out string assemblyName
)
Summary
Decodes the XML namespace and assembly names from the provided common language run-time namespace.
C# Syntax:
public static bool DecodeXmlNamespaceForClrTypeNamespace(
   string inNamespace,
   out string typeNamespace,
   out string assemblyName
);
Parameters:

inNamespace

The common language run-time namespace.

typeNamespace

When this method returns, contains a String that holds the decoded namespace name. This parameter is passed uninitialized.

assemblyName

When this method returns, contains a String that holds the decoded assembly name. This parameter is passed uninitialized.

Return Value:
true if the namespace and assembly names were successfully decoded; otherwise, false.
Exceptions
Exception Type Condition
ArgumentNullException The inNamespace parameter is null or empty.
Remarks
When the .NET Framework is parsing an XML stream, it needs to know how to convert the XML read from the stream into common language run-time types. The information that specifies how the .NET Framework should generate and parse an XML stream is stored in custom attributes that are located in the System.Runtime.Remoting.Metadata namespace. There are two ways to specify this information in a configuration file: either by explicitly specifying the mappings, or by specifying which object types to preload. The current method supports the retrieval of such mappings.

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~SoapServices();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetInteropFieldTypeAndNameFromXmlAttribute(
   Type containingType,
   string xmlAttribute,
   string xmlNamespace,
   out Type type,
   out string name
)
Summary
Retrieves field type from XML attribute name, namespace, and the Type of the containing object.
C# Syntax:
public static void GetInteropFieldTypeAndNameFromXmlAttribute(
   Type containingType,
   string xmlAttribute,
   string xmlNamespace,
   out Type type,
   out string name
);
Parameters:

containingType

The Type of the object containing the field.

xmlAttribute

The XML attribute name of the field type.

xmlNamespace

The XML namespace of the field type.

type

When this method returns, contains a Type of the field. This parameter is passed uninitialized.

name

When this method returns, contains a String that holds the name of the field. This parameter is passed uninitialized.

Remarks
Given the type of the containing object and the XML attribute and XML namespace that is read in by the .NET Framework, the current method returns the actual common language run-time field name and type of the field. The .NET Framework then uses this information to populate that field with the data read in from the XML stream.

Return to top


Method: GetInteropFieldTypeAndNameFromXmlElement(
   Type containingType,
   string xmlElement,
   string xmlNamespace,
   out Type type,
   out string name
)
Summary
Retrieves the Type and name of a field from the provided XML element name, namespace, and the containing type.
C# Syntax:
public static void GetInteropFieldTypeAndNameFromXmlElement(
   Type containingType,
   string xmlElement,
   string xmlNamespace,
   out Type type,
   out string name
);
Parameters:

containingType

The Type of the object containing the field.

xmlElement

The XML element name of field.

xmlNamespace

The XML namespace of the field type.

type

When this method returns, contains a Type of the field. This parameter is passed uninitialized.

name

When this method returns, contains a String that holds the name of the field. This parameter is passed uninitialized.

Remarks
Given the type of the containing object and the XML element and XML namespace that is read in by the .NET Framework, this method returns the actual common language run-time field name and type of the field. The .NET Framework then uses this information to populate that field with the data read in from the XML stream.

Return to top


Method: GetInteropTypeFromXmlElement(
   string xmlElement,
   string xmlNamespace
)
Summary
Retrieves the Type that should be used during deserialization of an unrecognized object type with the given XML element name and namespace.
C# Syntax:
public static Type GetInteropTypeFromXmlElement(
   string xmlElement,
   string xmlNamespace
);
Parameters:

xmlElement

The XML element name of the unknown object type.

xmlNamespace

The XML namespace of the unknown object type.

Return Value:
The Type of object associated with the specified XML element name and namespace.
Remarks
The current method returns values set up through SoapServices.RegisterInteropXmlElement and SoapServices.PreLoad.

Return to top


Method: GetInteropTypeFromXmlType(
   string xmlType,
   string xmlTypeNamespace
)
Summary
Retrieves the object Type that should used be during deserialization of an unrecognized object type with the given XML type name and namespace.
C# Syntax:
public static Type GetInteropTypeFromXmlType(
   string xmlType,
   string xmlTypeNamespace
);
Parameters:

xmlType

The XML type of the unknown object type.

xmlTypeNamespace

The XML type namespace of the unknown object type.

Return Value:
The Type of object associated with the specified XML type name and namespace.
Remarks
The current method returns values set up through SoapServices.RegisterInteropXmlType and SoapServices.PreLoad.

Return to top


Method: GetSoapActionFromMethodBase(
   MethodBase mb
)
Summary
Returns the SOAPAction value associated with the method specified in the given MethodBase.
C# Syntax:
public static string GetSoapActionFromMethodBase(
   MethodBase mb
);
Parameters:

mb

The MethodBase containing the method for which a SOAPAction is requested.

Return Value:
The SOAPAction value associated with the method specified in the given MethodBase.
Remarks
If the given MethodBase has not been registered with any SOAPAction value, the SoapServices.GetSoapActionFromMethodBase method returns the SOAPAction automatically cached with the MethodBase.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetTypeAndMethodNameFromSoapAction(
   string soapAction,
   out string typeName,
   out string methodName
)
Summary
Determines the type and method name of the method associated with the specified SOAPAction value.
C# Syntax:
public static bool GetTypeAndMethodNameFromSoapAction(
   string soapAction,
   out string typeName,
   out string methodName
);
Parameters:

soapAction

The SOAPAction of the method for which the type and method names were requested.

typeName

When this method returns, contains a String that holds the type name of the method in question. This parameter is passed uninitialized.

methodName

When this method returns, contains a String that holds the method name of the method in question. This parameter is passed uninitialized.

Return Value:
true if the type and method name were successfully recovered; otherwise, false.
Exceptions
Exception Type Condition
RemotingException The SOAPAction value does not start and end with quotes.
Remarks
true if the type and method name lookups were successful; otherwise, false.

Return to top


Method: GetXmlElementForInteropType(
   Type type,
   out string xmlElement,
   out string xmlNamespace
)
Summary
Returns XML element information that should be used when serializing the given type.
C# Syntax:
public static bool GetXmlElementForInteropType(
   Type type,
   out string xmlElement,
   out string xmlNamespace
);
Parameters:

type

The object Type for which the XML element and namespace names were requested.

xmlElement

When this method returns, contains a String that holds the XML element name of the specified object type. This parameter is passed uninitialized.

xmlNamespace

When this method returns, contains a String that holds the XML namespace name of the specified object type. This parameter is passed uninitialized.

Return Value:
true if the requested values have been set flagged with SoapTypeAttribute; otherwise, false.
See also:
SoapServices.GetInteropFieldTypeAndNameFromXmlElement

Return to top


Method: GetXmlNamespaceForMethodCall(
   MethodBase mb
)
Summary
Retrieves the XML namespace used during remote calls of the method specified in the given MethodBase.
C# Syntax:
public static string GetXmlNamespaceForMethodCall(
   MethodBase mb
);
Parameters:

mb

The MethodBase of the method for which the XML namespace was requested.

Return Value:
The XML namespace used during remote calls of the specified method.

Return to top


Method: GetXmlNamespaceForMethodResponse(
   MethodBase mb
)
Summary
Retrieves the XML namespace used during the generation of responses to the remote call to the method specified in the given MethodBase.
C# Syntax:
public static string GetXmlNamespaceForMethodResponse(
   MethodBase mb
);
Parameters:

mb

The MethodBase of the method for which the XML namespace was requested.

Return Value:
The XML namespace used during the generation of responses to a remote method call.

Return to top


Method: GetXmlTypeForInteropType(
   Type type,
   out string xmlType,
   out string xmlTypeNamespace
)
Summary
Returns XML type information that should be used when serializing the given Type.
C# Syntax:
public static bool GetXmlTypeForInteropType(
   Type type,
   out string xmlType,
   out string xmlTypeNamespace
);
Parameters:

type

The object Type for which the XML element and namespace names were requested.

xmlType

The XML type of the specified object Type.

xmlTypeNamespace

The XML type namespace of the specified object Type.

Return Value:
true if the requested values have been set flagged with SoapTypeAttribute; otherwise, false.
See also:
SoapServices.GetInteropFieldTypeAndNameFromXmlElement

Return to top


Method: IsClrTypeNamespace(
   string namespaceString
)
Summary
Returns a Boolean value indicating whether the specified namespace is native to the common language run-time.
C# Syntax:
public static bool IsClrTypeNamespace(
   string namespaceString
);
Parameters:

namespaceString

The namespace to check in the common language run-time.

Return Value:
true if the given namespace is native to the common language run-time; otherwise, false.
Remarks
The current method is used by the SoapSuds tool to determine whether an XML namespace represents a common language run-time type or a type from a non-common language run-time system.

For more information on SoapSuds see .

Return to top


Method: IsSoapActionValidForMethodBase(
   string soapAction,
   MethodBase mb
)
Summary
Determines if the specified SOAPAction is acceptable for a given MethodBase.
C# Syntax:
public static bool IsSoapActionValidForMethodBase(
   string soapAction,
   MethodBase mb
);
Parameters:

soapAction

The SOAPAction to check against the given MethodBase.

mb

The MethodBase the specified SOAPAction is checked against.

Return Value:
true if the specified SOAPAction is acceptable for a given MethodBase; otherwise, false.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Overloaded Method: PreLoad(
   Assembly assembly
)
Summary
Preloads every Type found in the specified Assembly from the information found in the SoapTypeAttributes (see SoapTypeAttribute) associated with the object types.
C# Syntax:
public static void PreLoad(
   Assembly assembly
);
Parameters:

assembly

The Assembly for each type of which to call SoapServices.PreLoad.

Remarks
When the .NET Framework is parsing an XML stream, it needs to know how to convert the XML read from the stream into common language run-time types. The information that specifies how the .NET Framework should generate and parse an XML stream is stored in custom attributes that are located in the System.Runtime.Remoting.Metadata namespace. There are two ways to specify this information in a configuration file: either by explicitly specifying the mappings, or by specifying which object types to preload. The custom attributes are read during the preloading process and the information in them is made available to the SOAP parser.

Return to top


Overloaded Method: PreLoad(
   Type type
)
Summary
Registers the given object Type based on values set in a SoapTypeAttribute on the type.
C# Syntax:
public static void PreLoad(
   Type type
);
Parameters:

type

The Type to preload.

Remarks
When the .NET Framework is parsing an XML stream, it needs to know how to convert the XML read from the stream into common language run-time types. The information that specifies how the .NET Framework should generate and parse an XML stream is stored in custom attributes that are located in the System.Runtime.Remoting.Metadata namespace. There are two ways to specify this information in a configuration file: either by explicitly specifying the mappings, or by specifying which object types to preload. The custom attributes are read during the preloading process and the information in them is made available to the SOAP parser.

Return to top


Method: RegisterInteropXmlElement(
   string xmlElement,
   string xmlNamespace,
   Type type
)
Summary
Associates the given XML element name and namespace with a run-time type that should be used for deserialization.
C# Syntax:
public static void RegisterInteropXmlElement(
   string xmlElement,
   string xmlNamespace,
   Type type
);
Parameters:

xmlElement

The XML element name to use in deserialization.

xmlNamespace

The XML namespace to use in deserialization.

type

The run-time Type to use in deserialization.

See also:
SoapServices.GetInteropFieldTypeAndNameFromXmlElement

Return to top


Method: RegisterInteropXmlType(
   string xmlType,
   string xmlTypeNamespace,
   Type type
)
Summary
Associates the given XML type name and namespace with the run-time type that should be used for deserialization.
C# Syntax:
public static void RegisterInteropXmlType(
   string xmlType,
   string xmlTypeNamespace,
   Type type
);
Parameters:

xmlType

The XML type to use in deserialization.

xmlTypeNamespace

The XML namespace to use in deserialization.

type

The run-time Type to use in deserialization.

Return to top


Overloaded Method: RegisterSoapActionForMethodBase(
   MethodBase mb
)
Summary
Associates the specified MethodBase with the SOAPAction cached with it.
C# Syntax:
public static void RegisterSoapActionForMethodBase(
   MethodBase mb
);
Parameters:

mb

The MethodBase of the method to associate with the SOAPAction cached with it.

Remarks
The SOAPAction of the specified method is contained in the SoapMethodAttribute.SoapAction property, or is read off the wire. The current method associates the SOAPAction with the MethodBase for use in channel sinks.

The SOAPAction HTTP request header field indicates the intent of the SOAP HTTP request. The value is a URI identifying the intent. SOAP places no restrictions on the format or specificity of the URI or that it is resolvable. An HTTP client must use this header field when issuing a SOAP HTTP Request.

Return to top


Overloaded Method: RegisterSoapActionForMethodBase(
   MethodBase mb,
   string soapAction
)
Summary
Associates the provided SOAPAction value with the given MethodBase for use in channel sinks.
C# Syntax:
public static void RegisterSoapActionForMethodBase(
   MethodBase mb,
   string soapAction
);
Parameters:

mb

The MethodBase to associate with the provided SOAPAction.

soapAction

The SOAPAction value to associate with the given MethodBase.

Remarks
The SOAPAction HTTP request header field indicates the intent of the SOAP HTTP request. The value is a URI identifying the intent. SOAP places no restrictions on the format or specificity of the URI or that it is resolvable. An HTTP client must use this header field when issuing a SOAP HTTP Request.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.