2011-12-22 13 views
1

C#で真の「viewfields」プロパティを設定する方法をinorderを私は「Getlistitems」SOAP呼び出しから返された「ows_MetaInfo」属性に必要ないくつかの値で取得します。コードを使用してXMLを作成している場合、これを行うにはどうすればいいですか?私はC#で真viewfieldsプロパティ=を設定しようとしています

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument(); 
      System.Xml.XmlElement query = xmlDoc.CreateElement("Query"); 
      System.Xml.XmlElement viewFields = xmlDoc.CreateElement("ViewFields"); 
      System.Xml.XmlElement rowLimit = xmlDoc.CreateElement("RowLimit"); 
      System.Xml.XmlElement queryOptions = xmlDoc.CreateElement("QueryOptions"); 
      System.Xml.XmlElement webID = xmlDoc.CreateElement("WebID"); 

は最初http://msdn.microsoft.com/en-us/library/cc264031.aspxを見た後、私は運でviewFieldsプロパティを設定しようとした:

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument(); 
      System.Xml.XmlElement query = xmlDoc.CreateElement("Query"); 
      System.Xml.XmlElement viewFields = xmlDoc.CreateElement("ViewFields"); 
      viewFields.SetAttribute("Properties", "True"); 
      System.Xml.XmlElement rowLimit = xmlDoc.CreateElement("RowLimit"); 
      System.Xml.XmlElement queryOptions = xmlDoc.CreateElement("QueryOptions"); 
      System.Xml.XmlElement webID = xmlDoc.CreateElement("WebID"); 

答えて

3

[MS-LISTSWS]仕様は言う:

ViewFields.Properties:Trueの場合とメタ情報フィールドをFieldRef要素で参照されている場合、リスト項目に関連するプロパティは、接頭辞「ows_MetaInfo_」を持つプロトコル・サーバーの応答に戻されます。

したがって、<ViewFields>要素内に<FieldRef Name="MetaInfo" />を含める必要があります。

関連する問題