3.1.5.1.1 Rules for Sending Data

  1. The client MUST use one of wxf:Create, wxf:Command, or wxf:Send messages (as specified in [MS-WSMV]) to send PSRP messages to the server, depending on the circumstances. See section 3.1.5.3 for details.

  2. When sending any PSRP message (section 2.2), the message MUST first be fragmented into one or more fragments. See section 2.2.4 for the format of a fragment. The FragmentIds MUST be numbered consecutively beginning with 0.

  3. The fragments MUST be sent in ascending order of FragmentId, using either wxf:Create (section 3.1.5.3.3), wxf:Send (section 3.1.5.3.5) or wxf:Command (section 3.1.5.3.3).

  4. If multiple fragments can fit into a single WS-MAN message, then the single WS-MAN message SHOULD include as many fragments as possible (see [MS-WSMV], section 3.1.4.1.7). The fragments MUST be embedded in the order that the PSRP messages were generated.

  5. When sending fragments using wxf:Create or wxf:Command, the fragments MUST be base64 encoded, as specified in sections 3.1.5.3.3 and 3.1.5.3.3.

  6. When sending fragments using wxf:Send, the fragments MUST be sent with the Stream element (as specified in [MS-WSMV], section 2.2.4.40) set to either "stdin" or "pr". Fragments from RUNSPACEPOOL_HOST_RESPONSE and PIPELINE_HOST_RESPONSE messages (sections 3.1.5.4.16 and 3.1.5.4.28) SHOULD be sent using a "pr" stream. There can be multiple Stream elements in a Send Complex Type (as specified in [MS-WSMV], section 2.2.4.32). Multiple fragments can be concatenated and sent in a single Stream element. An individual fragment cannot be broken down and cannot span multiple Stream elements. The PowerShell Remoting Protocol does not encode fragments sent using wxf:Send messages, instead relying on the encoding being done by Web Services Management Protocol Extensions for Windows Vista (see [MS-WSMV], section 2.2.4.40 for allowed encodings).