3.2.4.2.2 Invoking Custom Methods with a Stream Output Parameter

The WS-Management Protocol is used to invoke a method on a CIM class or instance. The method can have a parameter of type stream, such as:

 class ContactInfo :  Address
 {
                 string phoneNumber[];
                 uint32 GetPhoneNumbers([out, stream] string PhoneNumbers[]);        
 };

When the CIM class or instance accepts a stream parameter, the WMI provider will return results as one or more messages in streaming fashion, before returning a final result of the method invocation as specified in [DMTF-DSP0227-1.1.0]. The flow of messages is shown in the following diagram. In this diagram, "[C1]" indicates that the messages are sent on the primary HTTP connection.

Message sequence for invoking custom methods with stream output parameter

Figure 8: Message sequence for invoking custom methods with stream output parameter

The output messages returned by the WMI provider are formatted as follows.

 <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.dmtf.org/wbem/wsman/1/wsman.xsd"            xmlns:wm="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd"            xmlns:i="http://schemas.microsoft.com/wbem/wsman/1/cim/interactive.xsd" >
   <s:Header>
     <a:To>…</a:To>
     <a:ReplyTo>
       <a:Address s:mustUnderstand="true">
         http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
       </a:Address>
     </a:ReplyTo>
     <w:MaxEnvelopeSize s:mustUnderstand="true">
       153600
     </w:MaxEnvelopeSize>
     <w:Locale xml:lang="en-US" s:mustUnderstand="false" />
     <wm:DataLocale xml:lang="en-US" s:mustUnderstand="false" />
     <wm:OperationId s:mustUnderstand="false">
       uuid:…
     </wm:OperationId>
     <a:MessageID>uuid:…</a:MessageID>
     <w:ResourceURI s:mustUnderstand="true">
       http://schemas.microsoft.com/wbem/wsman/1/cim/(...)/ExtendedSemantics
     </w:ResourceURI>
     <a:Action s:mustUnderstand="true">
       http://schemas.microsoft.com/wbem/wsman/1/cim/(...)/InteractiveCallback
     </a:Action>
   </s:Header>  
   <s:Body>
     <i:InteractiveEvent>
       <i:EventType>StreamingOutput</i:EventType>
       <i:Name>PhoneNumbers</i:Name>
       <i:Type>5</i:Type>
       <i:Value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/ContactInfo" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common">
         <p:PhoneNumbers xsi:type="cim:cimString">123-456-7890</p:PhoneNumbers>
       </i:Value>
     </i:InteractiveEvent>
   </s:Body>
 </s:Envelope>

After sending the output messages, the WMI provider will send a final message with the result of the invocation.  This message is formatted as follows:

 <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.dmtf.org/wbem/wsman/1/wsman.xsd"            xmlns:wm="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd"            xmlns:i="http://schemas.microsoft.com/wbem/wsman/1/cim/interactive.xsd" >
   <s:Header>
     <a:To>…</a:To>
     <a:ReplyTo>
       <a:Address s:mustUnderstand="true">
         http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
       </a:Address>
     </a:ReplyTo>
     <w:MaxEnvelopeSize s:mustUnderstand="true">
       153600
     </w:MaxEnvelopeSize>
     <w:Locale xml:lang="en-US" s:mustUnderstand="false" />
     <wm:DataLocale xml:lang="en-US" s:mustUnderstand="false" />
     <wm:OperationId s:mustUnderstand="false">
       uuid:…
     </wm:OperationId>
     <a:MessageID>uuid:…</a:MessageID>
     <w:ResourceURI s:mustUnderstand="true">
       http://schemas.microsoft.com/wbem/wsman/1/cim/(...)/ExtendedSemantics
     </w:ResourceURI>
     <a:Action s:mustUnderstand="true">
       http://schemas.microsoft.com/wbem/wsman/1/cim/(...)/InteractiveCallback
     </a:Action>
   </s:Header>  
   <s:Body>
     <p:GetPhoneNumbers_OUTPUT xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/ContactInfo>
         <p:ReturnValue xsi:type="cim:cimunsignedInt">0</p:ReturnValue>
     </p:GetPhoneNumbers_OUTPUT>
   </s:Body>
 </s:Envelope>