3.1.4.1.31.1 I/O Streams

The Web Services Management Protocol Extensions for Windows Vista client in the Text-based Command Shell scenario interacts with the remote command, and in the Custom Remote Shell, the scenario interacts with the Shell by sending and receiving I/O streams. This section discusses how the I/O streams are encoded within Send and Receive messages.

The Web Services Management Protocol Extensions for Windows Vista supports one input stream (stdin) and two output streams (stdout and stderr). The name attribute of the rsp:Stream element SHOULD be one of these values. The rsp:Send or rsp:ReceiveResponse elements can contain more than one stream data block. Each MUST be encoded by using base64binary.

     <s:Body>
          ...
       <rsp:Stream Name="stdout" CommandId="xs:anyURI">
          ...encoded data...
       </rsp:Stream>
       <rsp:Stream Name="stderr" CommandId="xs:anyURI">
          ...encoded data...
       </rsp:Stream>
          ...
     </s:Body>

For any Shell scenario, a stream can be targeted to either the shell, or to a particular command. A shell client indicates whether the Stream it sends or requests for is intended for the shell or a command.

If the stream is targeted to a particular command, it MUST be indicated by an optional attribute CommandId. The value of CommandId MUST be the value contained in the CommandResponse message, as shown in the following example:

     <rsp:Stream 
      Name="stdout" 
      CommandId="77df7bb6-b5a0-4777-abd9-9823c0774074">
        c3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpc=
     </rsp:Stream>
  

The CommandId attribute MUST be omitted if the stream is targeted to the Shell processor.

In the case of Text-based Command Shells, the input streams targeted for a shell SHOULD NOT be used to activate or execute a command, otherwise a wsman:InternalError fault is returned. For example, the client SHOULD NOT send a stream to the Shell that contains "cd" as data to get the "cd" command executed. Instead, the client SHOULD send the Command message where rsp:CommandLine will contain the "cd" command line.

In the case of Custom Remote Shells, no restrictions are placed on the content of the input streams.