4.7.1 Create Shell

This section shows how to use an wst:Create message to create a new Shell instance on the remote computer that does not have the client's profile. The client computer uses code page 437.

Create Request

 <s:Envelope 
   xmlns:s="http://www.w3.org/2003/05/soap-envelope"
   xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
   xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
   <s:Header>
     <wsa:To>
       http://localhost:80/wsman
     </wsa:To>
     <wsman:ResourceURI s:mustUnderstand="true">
       http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd
     </wsman:ResourceURI>
     <wsa:ReplyTo>
       <wsa:Address s:mustUnderstand="true">
         http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
       </wsa:Address>
     </wsa:ReplyTo>
     <wsa:Action s:mustUnderstand="true">
       http://schemas.xmlsoap.org/ws/2004/09/transfer/Create
     </wsa:Action>
     <wsman:MaxEnvelopeSize s:mustUnderstand="true">153600</wsman:MaxEnvelopeSize>
     <wsa:MessageID>uuid:AF6A2E07-BA33-496E-8AFA-E77D241A2F2F</wsa:MessageID>
     <wsman:Locale xml:lang="en-US" s:mustUnderstand="false" />
     <wsman:OptionSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <wsman:Option Name="WINRS_NOPROFILE">TRUE</wsman:Option>
       <wsman:Option Name="WINRS_CODEPAGE">437</wsman:Option>
     </wsman:OptionSet>
     <wsman:OperationTimeout>PT60.000S</wsman:OperationTimeout>
   </s:Header>
   <s:Body>
     <rsp:Shell 
 xmlns:rsp="http://schemas.microsoft.com/wbem/wsman/1/windows/shell">
       <rsp:Environment>
         <rsp:Variable Name="test">1</rsp:Variable>
       </rsp:Environment>
       <rsp:WorkingDirectory>d:\windows</rsp:WorkingDirectory>
       <rsp:Lifetime>PT1000.000S</rsp:Lifetime>
       <rsp:InputStreams>stdin</rsp:InputStreams>
       <rsp:OutputStreams>stdout stderr</rsp:OutputStreams>
     </rsp:Shell>
   </s:Body>
 </s:Envelope>

Create Response

  
 <s:Envelope xml:lang="en-US"
   xmlns:s="http://www.w3.org/2003/05/soap-envelope"
   xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
   xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
   <s:Header>
     <wsa:Action>
 http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse
     </wsa:Action>
       <wsa:MessageID>
         uuid:1BD7E077-34CD-46F9-8AC2-F7D004C3D858
       </wsa:MessageID><wsa:To>
         http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
       </wsa:To>
       <wsa:RelatesTo>uuid:AF6A2E07-BA33-496E-8AFA-E77D241A2F2F</wsa:RelatesTo>
   </s:Header>
   <s:Body>
         <wst:ResourceCreated
           xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"
           xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
           xmlns:wst="http://schemas.xmlsoap.org/ws/2004/09/transfer"
  xmlns:rsp="http://schemas.microsoft.com/wbem/wsman/1/windows/shell">
           <wsa:Address>
             http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
           </wsa:Address>
           <wsa:ReferenceParameters>
             <wsman:ResourceURI>
               http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd
             </wsman:ResourceURI>
             <wsman:SelectorSet>
               <wsman:Selector Name="ShellId">
                 uuid:C443F44F-28E4-486F-A5A1-12745F90CF5A
               </wsman:Selector>
             </wsman:SelectorSet>
             </wsa:ReferenceParameters>
         </wst:ResourceCreated>
       </s:Body>
 </s:Envelope>