示例#1
0
        public static void AssociatorNames(CimXmlWriter cxw, AssociatorNamesOpSettings settings, CimName defaultNamespace)
        {
            #region Acutal XML request
            /*
            <?xml version="1.0" encoding="utf-8" ?>
            <CIM CIMVERSION="2.0" DTDVERSION="2.0">
            <MESSAGE ID="40" PROTOCOLVERSION="1.0">
                <SIMPLEREQ>
                    <IMETHODCALL NAME="AssociatorNames">
                        <LOCALNAMESPACEPATH>
                            <NAMESPACE NAME="smash"></NAMESPACE>
                        </LOCALNAMESPACEPATH>
                        <IPARAMVALUE NAME="ObjectName">
                            <INSTANCENAME CLASSNAME="CIM_NFS">
                                <KEYBINDING NAME="CSCreationClassName">
                                    <KEYVALUE VALUETYPE="string">tCSCreationClassName</KEYVALUE>
                                </KEYBINDING>
                                <KEYBINDING NAME="CSName">
                                    <KEYVALUE VALUETYPE="string">tCSName</KEYVALUE>
                                </KEYBINDING>
                                <KEYBINDING NAME="CreationClassName">
                                    <KEYVALUE VALUETYPE="string">tCreationClassName</KEYVALUE>
                                </KEYBINDING>
                                <KEYBINDING NAME="Name">
                                    <KEYVALUE VALUETYPE="string">tName</KEYVALUE>
                                </KEYBINDING>
                            </INSTANCENAME>
                        </IPARAMVALUE>
                    </IMETHODCALL>
                </SIMPLEREQ>
            </MESSAGE>
            </CIM>
             */
            #endregion

            // Set the Method Name
            cxw.WriteIMethodCallStartElement("AssociatorNames");

            // Set the namespace
            cxw.WriteCimNamespace(defaultNamespace);

            // Write out the ObjectName
            cxw.WriteCimObjectName(settings);

            if (settings.AssocClass != null)
            {
                cxw.WriteIParameterElement();
                cxw.WriteNameAttributeString("AssocClass");
                cxw.WriteClassName(settings.AssocClass);
                cxw.WriteEndElement();//</IPARAMVALUE>
            }
            if (settings.ResultClass != null)
            {
                cxw.WriteIParameterElement();
                cxw.WriteNameAttributeString("ResultClass");
                cxw.WriteClassName(settings.ResultClass);
                cxw.WriteEndElement();//</IPARAMVALUE>
            }
            if ((settings.Role != null) && (settings.Role != string.Empty))
            {
                cxw.WriteIParameterElement();
                cxw.WriteNameAttributeString("Role");
                cxw.WriteValueString(settings.Role);
                cxw.WriteEndElement();//</IPARAMVALUE>
            }
            if ((settings.ResultRole != null) && (settings.ResultRole != string.Empty))
            {
                cxw.WriteIParameterElement();
                cxw.WriteNameAttributeString("ResultRole");
                cxw.WriteValueString(settings.ResultRole);
                cxw.WriteEndElement();//</IPARAMVALUE>
            }
            cxw.WriteEndElement();
        }
示例#2
0
        public static void Associators(CimXmlWriter cxw, AssociatorsOpSettings settings, CimName defaultNamespace)
        {
            // Set the Method Name
            cxw.WriteIMethodCallStartElement("Associators");

            // Set the namespace
            cxw.WriteCimNamespace(defaultNamespace);

            // Write out the ObjectName
            //cxw.WriteCimObjectName(settings.ObjectName);

            cxw.WriteCimObjectName(settings);

            if (settings.AssocClass != null)
            {
                cxw.WriteIParameterElement();
                cxw.WriteNameAttributeString("AssocClass");
                cxw.WriteClassName(settings.AssocClass);
                cxw.WriteEndElement();//</IPARAMVALUE>
            }
            if (settings.ResultClass != null)
            {
                cxw.WriteIParameterElement();
                cxw.WriteNameAttributeString("ResultClass");
                cxw.WriteClassName(settings.ResultClass);
                cxw.WriteEndElement();//</IPARAMVALUE>
            }
            if ((settings.Role != null) && (settings.Role != string.Empty))
            {
                cxw.WriteIParameterElement();
                cxw.WriteNameAttributeString("Role");
                cxw.WriteValueString(settings.Role);
                cxw.WriteEndElement();//</IPARAMVALUE>
            }
            if ((settings.ResultRole != null) && (settings.ResultRole != string.Empty))
            {
                cxw.WriteIParameterElement();
                cxw.WriteNameAttributeString("ResultRole");
                cxw.WriteValueString(settings.ResultRole);
                cxw.WriteEndElement();//</IPARAMVALUE>
            }
            if (settings.IncludeQualifiers == true)
            {
                cxw.WriteIParameterElement();
                cxw.WriteNameAttributeString("IncludeQualifiers");
                cxw.WriteValueString(settings.IncludeQualifiers.ToString());
                cxw.WriteEndElement();//</IPARAMVALUE>
            }
            if (settings.IncludeClassOrigin == true)
            {
                cxw.WriteIParameterElement();
                cxw.WriteNameAttributeString("IncludeClassOrigin");
                cxw.WriteValueString(settings.IncludeClassOrigin.ToString());
                cxw.WriteEndElement();//</IPARAMVALUE>
            }
            if ((settings.PropertyList != null) && (settings.PropertyList.Length > 0))
            {
                cxw.WriteIParameterElement();
                cxw.WriteNameAttributeString("PropertyList");
                cxw.WritePropertyList(settings.PropertyList);
                cxw.WriteEndElement();
            }

            cxw.WriteEndElement();
        }