3.1.5.3.14 Rules for the wxf:Connect Message

The client uses a wxf:Connect message (as specified in [MS-WSMV] section 3.1.4.17) to connect to a RunspacePool on the server. Before sending this message, the client discovers the RunspacePool identifiers available on the server by sending a wxf:Enumerate message (as specified in [MS-WSMV] section 3.1.4.8). The client then creates its own RunspacePool instance, assigns it an identifier from the list of available RunspacePool identifiers, and initializes its state to Connecting (section 3.1.1.2.2). The client supplies the following information for the wxf:Connect message.

Element

Value

Uri

The network URI to connect to.

ResourceURI

Any string adhering to the rules specified in [MS-WSMV] section 3.1.4.5.2.<7>

OptionSet

An option set with the following options:

Name = ProtocolVersion, MustComply=True, Value=2.1 or 2.2

Clients supply the following information in the wxf:Connect message for the shell data type, as specified in [MS-WSMV] section 2.2.4.12:

Element

Value

Resource

A valid PSRP connection string of the form "protocol://computername:port/applicationname", where protocol can be one of "http" or "https", computername is the name of the machine to connect to, port is the port number for the connection, and applicationname can be "WSMan" or any other application that supports the Web Services Management Protocol Extensions for Windows Vista.<8>

ShellID

The identifier of the RunspacePool the client intends to connect to.

<open content>

Additional data that assists in connecting to a shell on the server, if any, MUST be Base64 encoded (as specified in [RFC3548]) and packaged in a <connectXml> element with the following format:

 <connectXml   xmlns=http://schemas.microsoft.com/>
  Base64-Encoded   data
 </connectXml>

The <open content> MAY also contain any data that is useful to the shell.

The body of the message MAY<9> contain the following optional element:

Element

Value

BufferMode

Either of the values "Drop" or "Block" to indicate the buffering mode the server will use when the shell is later disconnected.

If the wxf:Connect message is successfully received and processed by the server, the server MUST send either a success or a failure message. The server sends a wxf:ConnectResponse message, described in [MS-WSMV] section 3.1.4.17, to indicate success. The server sends a wxf:Fault message, described in [MS-WSMV] section 2.2.4.43, to indicate failure.

The client MUST use a wxf:Connect message to send SESSION_CAPABILITY (section 2.2.2.1) and CONNECT_RUNSPACEPOOL (section 2.2.2.29) message data to the server. The client MUST NOT send any other message data using a wxf:Connect message.

The client also uses the wxf:Connect message to connect to a specific pipeline associated with a RunspacePool. Once the RunspacePool is connected using the wxf:Connect message, the client MUST issue a separate wxf:Connect message to connect to a specific pipeline. The following additional information MUST be added to the body of the second wxf:Connect message:

Element

Value

CommandId

The identifier of the pipeline that the client intends to connect to.

Once connected, the client can use the wxf:Send and wxf:Receive messages to send input to and receive output from a pipeline.