4.3 Update Book Information

In this example, a protocol client sends a request to update author and status information for the book that is associated with the identifier "2e80eb25-b64a-4506-b87b-2fff6ddb3f57", and to retrieve information about all of the books in the catalog.

The protocol client sends the following message:

 <Request 
   AddExpandoFieldTypeSuffix="true" 
   SchemaVersion="15.0.0.0" 
   LibraryVersion="15.0.0.0" 
   ApplicationName=".NET Library" 
   xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
   <Actions>
     <ObjectPath Id="18" ObjectPathId="17" />
     <ObjectPath Id="20" ObjectPathId="19" />
     <ObjectPath Id="22" ObjectPathId="21" />
     <SetProperty Id="23" ObjectPathId="21" Name="Author">
       <Parameter Type="String">Lisa Andrews</Parameter>
     </SetProperty>
     <SetProperty Id="24" ObjectPathId="21" Name="Status">
       <Parameter Type="Enum">1</Parameter>
     </SetProperty>
     <Method Name="Update" Id="25" ObjectPathId="21" />
     <Query Id="26" ObjectPathId="19">
       <Query SelectAllProperties="true">
         <Properties />
       </Query>
       <ChildItemQuery SelectAllProperties="true">
         <Properties />
       </ChildItemQuery>
     </Query>
   </Actions>
   <ObjectPaths>
     <StaticProperty Id="17" TypeId="{acc57e47-24b0-4400-b1c7-aa1cf3c9542d}" Name="Catalog" />
     <Property Id="19" ParentId="17" Name="Books" />
     <Method Id="21" ParentId="19" Name="GetById">
       <Parameters>
         <Parameter Type="Guid">{2e80eb25-b64a-4506-b87b-2fff6ddb3f57}</Parameter>
       </Parameters>
     </Method>
   </ObjectPaths>
 </Request>

The protocol server responds with the following message:

 [
   {
     "SchemaVersion" : "15.0.0.0",
     "LibraryVersion" : "15.0.3421.3000",
     "ErrorInfo" : null
   },
   18,
   {
     "IsNull" : false
   },
   20,
   {
     "IsNull" : false
   },
   22,
   {
     "IsNull" : false
   },
   26,
   {
     "_ObjectType_" : "SampleCode.BookCollection",
     "_Child_Items_" : [
       {
         "_ObjectType_" : "SampleCode.Book",
         "Author" : "Soha Kamal",
         "Id" : "\/Guid(3387ac63-e73d-421f-bff7-359a4aa2bc38)\/",
         "PublishDate" : "\/Date(2008,2,1,0,0,0,0)\/",
         "Status" : 0,
         "Title" : "How to Cook Chinese Food"
       },
       {
         "_ObjectType_" : "SampleCode.Book",
         "Author" : "Soha Kamal",
         "Id" : "\/Guid(f6a265ab-86e5-4fbf-937c-49923604b91d)\/",
         "PublishDate" : "\/Date(2007,4,4,0,0,0,0)\/",
         "Status" : 1,
         "Title" : "How to Cook Japanese Food"
       },
       {
         "_ObjectType_" : "SampleCode.Book",
         "Author" : "Lisa Andrews",
         "Id" : "\/Guid(2e80eb25-b64a-4506-b87b-2fff6ddb3f57)\/",
         "PublishDate" : "\/Date(2009,0,3,0,0,0,0)\/",
         "Status" : 1,
         "Title" : "Best Recipe"
       },
       {
         "_ObjectType_" : "SampleCode.Book",
         "Author" : "Patrick Hines",
         "Id" : "\/Guid(704655a3-c136-469c-a578-f79652a93f9b)\/",
         "PublishDate" : "\/Date(2005,11,1,0,0,0,0)\/",
         "Status" : 0,
         "Title" : "Family Recipe"
       }
     ]
   }
 ]