locked
Windows WS-Management service did not support the 'PUT' method? RRS feed

  • General discussion

  • Hi, all.

    I'm trying to update some WMI class instance like Msvm_ComputerSystem, Msvm_ProcessorSettingData with the different WsMan utilities: one is written by our company, the next one is the openwsman for linux-based systems, and the last is winrm from the other windows 2012 computer. From all of it I could request put query with soap body like this one:

    <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:addr="http://schemas.xmlsoap.org/ws/2004/08/addressing"
        xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
        <env:Header>
            <addr:To env:mustUnderstand="true">http://192.168.111.174:5985/wsman</addr:To>
            <addr:ReplyTo>
                <addr:Address env:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</addr:Address>
            </addr:ReplyTo>
            <wsman:MaxEnvelopeSize env:mustUnderstand="true">131072</wsman:MaxEnvelopeSize>
            <addr:MessageID env:mustUnderstand="true">e32c7eab-a27b-46a8-9343-13dc447072fc</addr:MessageID>
            <wsman:ResourceURI env:mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/v2/Msvm_ProcessorSettingData</wsman:ResourceURI>
            <addr:Action env:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</addr:Action>
            <wsman:OperationTimeout>PT60.000S</wsman:OperationTimeout>
            <wsman:SelectorSet>
                <wsman:Selector Name="InstanceID">Microsoft:D3662848-4C35-49EA-9680-010DF6A9E71B\b637f346-6a0e-4dec-af52-bd70cb80a21d\0</wsman:Selector>
            </wsman:SelectorSet>
        </env:Header>
        <env:Body>
            <p:Msvm_ProcessorSettingData
                xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/v2/Msvm_ProcessorSettingData">
                <p:VirtualQuantity>2</p:VirtualQuantity>
            </p:Msvm_ProcessorSettingData>
        </env:Body>
    </env:Envelope>

    And I'm getting the response with the old VirtualQuantity values without any error 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:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"
        xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd">
        <s:Header>
            <a:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/PutResponse</a:Action>
            <a:MessageID>uuid:9DFBC1D3-5E96-4917-86D6-CBBB6003A2A7</a:MessageID>
            <a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
            <a:RelatesTo>27b78a50-b328-44a8-aa43-038f35fd3028</a:RelatesTo>
        </s:Header>
        <s:Body>
            <p:Msvm_ProcessorSettingData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/Msvm_ProcessorSettingData"
                xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xsi:type="p:Msvm_ProcessorSettingData_Type">
                <p:Address xsi:nil="true" />
                <p:AllocationUnits>Processor Cores</p:AllocationUnits>
                <p:AutomaticAllocation>true</p:AutomaticAllocation>
                <p:AutomaticDeallocation>true</p:AutomaticDeallocation>
                <p:Caption>Processor</p:Caption>
                <p:ConsumerVisibility>3</p:ConsumerVisibility>
                <p:Description>Settings for Microsoft Virtual Processor.</p:Description>
                <p:DeviceID xsi:nil="true" />
                <p:DeviceIDFormat xsi:nil="true" />
                <p:ElementName>Processor</p:ElementName>
                <p:InstanceID>Microsoft:D3662848-4C35-49EA-9680-010DF6A9E71B\b637f346-6a0e-4dec-af52-bd70cb80a21d\0</p:InstanceID>
                <p:IsVirtualized>true</p:IsVirtualized>
                <p:Limit>100000</p:Limit>
                <p:LimitCPUID>false</p:LimitCPUID>
                <p:LimitProcessorFeatures>false</p:LimitProcessorFeatures>
                <p:MappingBehavior xsi:nil="true" />
                <p:OtherResourceType xsi:nil="true" />
                <p:Parent xsi:nil="true" />
                <p:PoolID>A4F3C4E4-5E15-4018-A713-96C2CFB4C9B8</p:PoolID>
                <p:ProcessorsPerSocket>6</p:ProcessorsPerSocket>
                <p:Reservation>0</p:Reservation>
                <p:ResourceSubType>Microsoft Processor</p:ResourceSubType>
                <p:ResourceType>3</p:ResourceType>
                <p:SocketCount>1</p:SocketCount>
                <p:ThreadsEnabled xsi:nil="true" />
                <p:VirtualQuantity>6</p:VirtualQuantity>
                <p:Weight>100</p:Weight>
            </p:Msvm_ProcessorSettingData>
        </s:Body>
    </s:Envelope>

    As I could said, I have tried another utilities like winrm. My winrm request were like this:
    winrm s http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/v2/Msvm_ComputerSystem?CreationClassName=Msvm_ComputerSystem+Name=<vmUUID> -r:http://<hostIP>/wsman -u:<username> -p:<password> @{ElementName="testName"}
    But for this request I'm getting the response with previous values too. And the same situation with wsman on the Linux-based system.
    So, my question is what's wrong? Is it something in my request? Maybe 'PUT' functionality is not supported by the Windows WsManagement service?

    Friday, September 4, 2015 8:33 AM

All replies

  • Hello MaSTeRAlexander,
                                     Thank you for your inquiry about WSMAN protocol. One of the Open specifications team member will contact you shortly.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications
    Friday, September 4, 2015 2:22 PM
  • Hello MaSTeRAlexander,

    I am the engineer who will be working with you on this issue.  I am currently researching the question and will provide you with an update soon. Thank you for your patience.

    Thanks,
    Nathan Manis
    Microsoft Windows Open Specifications

    Tuesday, September 8, 2015 7:32 PM
  • Hi MaSTeRAlexander,

    From reviewing this further here and the code, we can state that the Windows Management service does support the PUT operation.   However, it is defined in the spec to support the URI's defined in the document section 3.1.4.1.  The documentation is a bit dated as this was with Windows 2003 but shows the list.

        https://msdn.microsoft.com/en-us/library/cc251395.aspx

    In researching, people have been successful in using WS-Management.   Here is an example post:

    https://somethingaboutcode.wordpress.com/2009/11/09/invoking-hyper-v-wmi-api-methods-with-reference-parameters-using-ws-management/

    Thanks,
    Nathan Manis
    Microsoft Windows Open Specifications

    Monday, September 21, 2015 7:03 PM