4.1.3 Modifying an Instance

To modify an instance, a Put request is used. Using the example from section 4.1.1, the following exchange shows the Data1 property being modified from "Hello World" to "Test String" in an instance of MyClass.

Put Request:

 <s:Envelope xmlns:s=
 "http://www.w3.org/2003/05/soap-envelope" 
 xmlns:a=
 "http://schemas.xmlsoap.org/ws/2004/08/addressing" 
 xmlns:w=
 "http://schemas.xmlsoap.org/ws/2005/06/management">
 <s:Header>
 <a:To>http://server:80/wsman</a:To>
 <w:ResourceURI s:mustUnderstand="true">
 http://schemas.microsoft.com/
 wsman/2005/06/wmi/root/mynamespace/myclass
 </w:ResourceURI>
 <a:ReplyTo>
 <a:Address s:mustUnderstand="true">
 http://schemas.xmlsoap.org/ws/
 2004/08/addressing/role/anonymous</a:Address>
 </a:ReplyTo>
 <a:Action s:mustUnderstand="true">
 http://schemas.xmlsoap.org/ws/2004/09/transfer/Put
 </a:Action>
 <w:MaxEnvelopeSize s:mustUnderstand="true">
 51200
 </w:MaxEnvelopeSize>
 <a:MessageID>
 uuid:D1408048-E0F6-4C6D-8B8A-515B9F7B641C
 </a:MessageID>
 <w:SelectorSet>
 <w:Selector Name="id">1</w:Selector>
 </w:SelectorSet>
 <w:OperationTimeout>PT60.000S</w:OperationTimeout>
 </s:Header>
 <s:Body>
 <p:myclass xmlns:p=
 "http://schemas.microsoft.com/wsman/2005/06/wmi/
 root/mynamespace/myclass">
 <p:Data1>Test Message</p:Data1>
 <p:id>1</p:id>
 <cim:Location xmlns:cim=
 "http://schemas.dmtf.org/wsman/2005/06/
 base" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/
 addressing"
  xmlns:w="http://schemas.xmlsoap.org/ws/2005/06/
 management">
 <a:Address>http://schemas.xmlsoap.org/ws/2004/08/
 addressing/
 role/anonymous</a:Address>
 <a:ReferenceParameters>
 <w:ResourceURI>http://schemas.microsoft.com/
 wsman/2005/06/wmi/
 root/mynamespace/myclass</w:ResourceURI>
 <w:SelectorSet>
 <w:Selector Name="id">1</w:Selector>
 </w:SelectorSet>
 </a:ReferenceParameters>
 </cim:Location>
 </p:myclass>
 </s:Body>
 </s:Envelope>
  

Put Response:

 <s:Envelope xml:lang="en-US" xmlns:
 s="http://www.w3.org/2003/05/
 soap-envelope" xmlns:a=
 "http://schemas.xmlsoap.org/ws/2004/08/
 addressing" xmlns:w=
 "http://schemas.xmlsoap.org/ws/2005/06/management">
 <s:Header>
 <a:Action s:mustUnderstand="true">
 http://schemas.xmlsoap.org/
 ws/2004/09/transfer/PutResponse</a:Action>
 <a:MessageID s:mustUnderstand="true">
 uuid:92E94D15-B9D2-4DFB-AACF-9952F19B4AFB
 </a:MessageID>
 <a:To>http://schemas.xmlsoap.org/ws/2004/08/
 addressing/role/anonymous</a:To>
 <a:RelatesTo s:mustUnderstand="true">
 uuid:D1408048-E0F6-4C6D-8B8A-515B9F7B641C</a:RelatesTo>
 </s:Header>
 <s:Body>
 <p:myclass xmlns:p="http://schemas.microsoft.com/
 wsman/2005/06/wmi/root/mynamespace/myclass">
 <p:Data1>Test Message</p:Data1>
 <p:id>1</p:id>
 <cim:Location xmlns:cim="http://schemas.dmtf.org/
 wsman/2005/06/base" xmlns:a=
 "http://schemas.xmlsoap.org/ws/2004/
 08/addressing" xmlns:w=
 "http://schemas.xmlsoap.org/ws/2005/06/management">
 <a:Address>
 http://schemas.xmlsoap.org/ws/2004/08/addressing/
 role/anonymous</a:Address>
 <a:ReferenceParameters>
 <w:ResourceURI>
 http://schemas.microsoft.com/wsman/2005/06/wmi/
 root/mynamespace/myclass</w:ResourceURI>
 <w:SelectorSet>
 <w:Selector Name="id">1</w:Selector>
 </w:SelectorSet>
 </a:ReferenceParameters>
 </cim:Location>
 </p:myclass>
 </s:Body>
 </s:Envelope>