4.4 Searching for Tasks
The following example demonstrates a client’s request to find all tasks on the server that contain the word "Test", and the server’s response. The client sends a Search command request ([MS-ASCMD] section 2.2.1.16) to the server, and the server responds with a Search command response ([MS-ASCMD] section 2.2.1.16). This example assumes that the server has assigned a Collection ID of 11 to the Tasks collection.
Request:
-
<?xml version="1.0" encoding="utf-8"?> <Search xmlns="Search:" xmlns:airsync="AirSync:" > <Store> <Name>Mailbox</Name> <Query> <And> <airsync:Class>Tasks</airsync:Class> <airsync:CollectionId>11</airsync:CollectionId> <FreeText>Test</FreeText> </And> </Query> <Options> <RebuildResults /> <Range>0-4</Range> </Options> </Store> </Search>
Response:
-
<Search xmlns:A0="AirSync:" xmlns:tasks="Tasks:" xmlns:airsyncbase="AirSyncBase:" xmlns="Search:"> <Status>1 Success</Status> <Response> <Store> <Status>1 Success</Status> <Result> <A0:Class>Tasks</A0:Class> <LongId>RgAAAADl9NP3UFJNRpgIYBWT6lSUBwDqXN0OYiDySoYnY1igrbIlAAAAAAAqAADqXN0OYiDySoYnY1igrbIlAAAAAGHBAAAT</LongId> <A0:CollectionId>11</A0:CollectionId> <Properties> <airsyncbase:Body> <airsyncbase:Type>1</airsyncbase:Type> <airsyncbase:EstimatedDataSize>0</airsyncbase:EstimatedDataSize> <airsyncbase:Truncated>1</airsyncbase:Truncated> </airsyncbase:Body> <tasks:Subject>Complete This Week's Test Run </tasks:Subject> <tasks:Importance>2</tasks:Importance> <tasks:UtcStartDate>2009-11-18T08:00:00.000Z</tasks:UtcStartDate> <tasks:StartDate>2009-11-18T00:00:00.000Z</tasks:StartDate> <tasks:UtcDueDate>2009-11-27T08:00:00.000Z</tasks:UtcDueDate> <tasks:DueDate>2009-11-27T00:00:00.000Z</tasks:DueDate> <tasks:Complete>0</tasks:Complete> <tasks:Sensitivity>2</tasks:Sensitivity> <tasks:ReminderTime>2009-11-27T16:00:00.000Z</tasks:ReminderTime> <tasks:ReminderSet>1</tasks:ReminderSet> </Properties> </Result> <Range>0-0</Range> <Total>1</Total> </Store> </Response> </Search>