Activator.GetObject Method

Definition

Creates a proxy for a well-known object or XML Web service.

Overloads

GetObject(Type, String)

Creates a proxy for the well-known object indicated by the specified type and URL.

GetObject(Type, String, Object)

Creates a proxy for the well-known object indicated by the specified type, URL, and channel data.

GetObject(Type, String)

Creates a proxy for the well-known object indicated by the specified type and URL.

public:
 static System::Object ^ GetObject(Type ^ type, System::String ^ url);
public static object GetObject (Type type, string url);
[System.Security.SecurityCritical]
public static object GetObject (Type type, string url);
static member GetObject : Type * string -> obj
[<System.Security.SecurityCritical>]
static member GetObject : Type * string -> obj
Public Shared Function GetObject (type As Type, url As String) As Object

Parameters

type
Type

The type of the well-known object to which you want to connect.

url
String

The URL of the well-known object.

Returns

A proxy that points to an endpoint served by the requested well-known object.

Attributes

Exceptions

type or url is null.

type is not marshaled by reference and is not an interface.

This member was invoked with a late-binding mechanism.

Remarks

Call the proxy to send messages to the remote object. No messages are sent over the network until a method is called on the proxy.

See also

Applies to

GetObject(Type, String, Object)

Creates a proxy for the well-known object indicated by the specified type, URL, and channel data.

public:
 static System::Object ^ GetObject(Type ^ type, System::String ^ url, System::Object ^ state);
public static object GetObject (Type type, string url, object state);
[System.Security.SecurityCritical]
public static object GetObject (Type type, string url, object state);
static member GetObject : Type * string * obj -> obj
[<System.Security.SecurityCritical>]
static member GetObject : Type * string * obj -> obj
Public Shared Function GetObject (type As Type, url As String, state As Object) As Object

Parameters

type
Type

The type of the well-known object to which you want to connect.

url
String

The URL of the well-known object.

state
Object

Channel-specific data or null.

Returns

A proxy that points to an endpoint served by the requested well-known object.

Attributes

Exceptions

type or url is null.

type is not marshaled by reference and is not an interface.

This member was invoked with a late-binding mechanism.

Remarks

Call the proxy to send messages to the remote object. No messages are sent over the network until a method is called on the proxy.

The state parameter communicates information to the channel, and is passed to the IChannelSender.CreateMessageSink method.

See also

Applies to