WSS 3.0 list WebService usage

Source: Internet
Author: User
When all text fields are blank: <EQ> <fieldref name = 'textfieldname'/> <value type = 'text'> </value> </EQ>
When text field does not contain any characters: <isnull> <fieldref name = 'textfieldname'> </fieldref> </isnull>, the previous entry is invalid.
Text Field is case-insensitive, which depends mainly on the language settings of the database.

The format of user field is userid; # username, for example, 16; # Leo Ge
If a field is blank, this field may not be returned. The xmlnode attribute must be validated first, for example:
If (I. Attributes. getnameditem ("ows_machine ")! = NULL) taskitem. Machine = I. attributes ["ows_machine"]. value;

General getlistitems practices: Xmldocument xmldoc =   New Xmldocument ();
Xmlelement Query = Xmldoc. createelement ( " Query " );
Xmlelement viewfields = Xmldoc. createelement ( " Viewfields " );
Xmlelement queryoptions = Xmldoc. createelement ( " Queryoptions " );
Query. innerxml =   " <Where> "
+   " <Or> "
+   " <EQ> <fieldref name = 'macher'/> <value type = 'text'> "   + Machinename +   " </Value> </EQ> "
+   " <Or> "
+   " <Isnull> <fieldref name = 'macher'> </fieldref> </isnull> "
+   " <EQ> <fieldref name = 'macher'/> <value type = 'text'> </value> </EQ> "
+   " </Or> "
+   " </Or> "
+   " </Where> " ;
Viewfields. innerxml =   "" ;
Queryoptions. innerxml =   "" ;
Xmlnode Node = WSS. getlistitems ( " {E7E1EEC8-F627-48A9-8228-F4BC1CA45F0C} " , " {FC3C7DFF-7399-4944-A155-56AF8BCB0F11} " , Query, viewfields, " 100 " , Queryoptions, Null );

Nametable NT =   New Nametable ();
Xmlnamespacemanager xnm =   New Xmlnamespacemanager (NT );
Xnm. addnamespace ( " RS " , " URN: Schemas-Microsoft-com: rowset " );
Xnm. addnamespace ( " Z " , " # Rowsetschema " );

Xmldoc =   New Xmldocument ();
Xmldoc. importnode (node, True );

Foreach (Xmlnode I In Node. selectnodes ( " RS: Data/Z: Row " , Xnm ))
{
Int ID = Int . Parse (I. attributes [ " Ows_id " ]. Value );
String Title = I. attributes [ " Ows_title " ]. Value;
Bool Reloaddata = I. attributes [ " Ows_reload_x0020_data " ]. Value =   " 1 "   ?   True : False ;
Datetime created = Datetime. parse (I. attributes [ " Ows_created " ]. Value );
String Createdby = I. attributes [ " Ows_author " ]. Value; // Format: userid; # Username
Datetime modified = Datetime. parse (I. attributes [ " Ows_modified " ]. Value );
String Modifiedby = I. attributes [ " Ows_editor " ]. Value; // Format: userid; # Username
Enumstatus status = (Enumstatus) enum. parse ( Typeof (Enumstatus), I. attributes [ " Ows_status " ]. Value );
If (I. Attributes. getnameditem ( " Ows_machine " ) ! = Null ) {//Fields that may be null must be checked first.
StringMachine=I. attributes ["Ows_machine"]. Value;
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.