Muokkaa

Jaa


SoapServices.PreLoad Method

Definition

Preloads specified types based on values set in the SoapTypeAttribute applied to the types.

Overloads

PreLoad(Assembly)

Preloads every Type found in the specified Assembly from the information found in the SoapTypeAttribute associated with each type.

PreLoad(Type)

Preloads the given Type based on values set in a SoapTypeAttribute on the type.

PreLoad(Assembly)

Preloads every Type found in the specified Assembly from the information found in the SoapTypeAttribute associated with each type.

public:
 static void PreLoad(System::Reflection::Assembly ^ assembly);
public static void PreLoad (System.Reflection.Assembly assembly);
[System.Security.SecurityCritical]
public static void PreLoad (System.Reflection.Assembly assembly);
static member PreLoad : System.Reflection.Assembly -> unit
[<System.Security.SecurityCritical>]
static member PreLoad : System.Reflection.Assembly -> unit
Public Shared Sub PreLoad (assembly As Assembly)

Parameters

assembly
Assembly

The Assembly for each type of which to call PreLoad(Type).

Attributes

Exceptions

The immediate caller does not have infrastructure permission.

Examples

The following code example shows how to use this method. This code example is part of a larger example provided for the SoapServices class.

// Register all types in the assembly with the SoapType attribute.
System::Reflection::Assembly^ executingAssembly =
   System::Reflection::Assembly::GetExecutingAssembly();
SoapServices::PreLoad( executingAssembly );
// Register all types in the assembly with the SoapType attribute.
System.Reflection.Assembly executingAssembly =
    System.Reflection.Assembly.GetExecutingAssembly();
SoapServices.PreLoad(executingAssembly);

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 runtime 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.

Applies to

PreLoad(Type)

Preloads the given Type based on values set in a SoapTypeAttribute on the type.

public:
 static void PreLoad(Type ^ type);
public static void PreLoad (Type type);
[System.Security.SecurityCritical]
public static void PreLoad (Type type);
static member PreLoad : Type -> unit
[<System.Security.SecurityCritical>]
static member PreLoad : Type -> unit
Public Shared Sub PreLoad (type As Type)

Parameters

type
Type

The Type to preload.

Attributes

Exceptions

The immediate caller does not have infrastructure permission.

Examples

The following code example shows how to use this method. This code example is part of a larger example provided for the SoapServices class.

// Register a specific type with the SoapType attribute.
Type^ exampleType = ExampleNamespace::ExampleClass::typeid;
SoapServices::PreLoad( exampleType );
// Register a specific type with the SoapType attribute.
Type exampleType = typeof(ExampleNamespace.ExampleClass);
SoapServices.PreLoad(exampleType);

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 runtime 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.

Applies to