4.1.3 Modifying an Instance
To modify an instance, a Put request is used. Using the example from Retrieving a CIM Instance (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: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://server:80/wsman</wsa:To> <wsman:ResourceURI s:mustUnderstand="true"> http://schemas.microsoft.com/wbem/wsman/1/wmi/root/mynamespace/myclass </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/Put </wsa:Action> <wsman:MaxEnvelopeSize s:mustUnderstand="true"> 51200 </wsman:MaxEnvelopeSize> <wsa:MessageID> uuid:D1408048-E0F6-4C6D-8B8A-515B9F7B641C </wsa:MessageID> <wsman:SelectorSet> <wsman:Selector Name="id">1</wsman:Selector> </wsman:SelectorSet> <wsman:OperationTimeout>PT60.000S</wsman:OperationTimeout> </s:Header> <s:Body> <p:myclass xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/mynamespace/myclass" > <p:Data1>Test Message</p:Data1> <p:id>1</p:id> <cim:Location xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"> <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/wmi/root/mynamespace/myclass </wsman:ResourceURI> <wsman:SelectorSet> <wsman:Selector Name="id">1</wsman:Selector> </wsman:SelectorSet> </wsa: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:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"> <s:Header> <wsa:Action s:mustUnderstand="true"> http://schemas.xmlsoap.org/ws/2004/09/transfer/PutResponse </wsa:Action> <wsa:MessageID s:mustUnderstand="true"> uuid:92E94D15-B9D2-4DFB-AACF-9952F19B4AFB </wsa:MessageID> <wsa:To> http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous </wsa:To> <wsa:RelatesTo s:mustUnderstand="true"> uuid:D1408048-E0F6-4C6D-8B8A-515B9F7B641C </wsa:RelatesTo> </s:Header> <s:Body> <p:myclass xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/mynamespace/myclass" > <p:Data1>Test Message</p:Data1> <p:id>1</p:id> <cim:Location xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"> <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/wmi/root/mynamespace/myclass </wsman:ResourceURI> <wsman:SelectorSet> <wsman:Selector Name="id">1</wsman:Selector> </wsman:SelectorSet> </wsa:ReferenceParameters> </cim:Location> </p:myclass> </s:Body> </s:Envelope>