How to use the GetChanges method of SiteData WebSe

2019-07-19 10:27发布

Can anyone elaborate on the parameter values to be supplied for GetChanges method of SiteData Web Service?

Basically I am not able to understand what value should we supply for startChangeID and EndChangeID and from where can we get these values?

Any help on this would be greatly appreciated.

Thanks.

1条回答
虎瘦雄心在
2楼-- · 2019-07-19 10:45

Try calling GetContent first with

string result = mysiteDataServiceInstance.GetContent(SiteDataService.ObjectType.ContentDatabase, 
myContentDbGuid.ToString(), "", "", false, false, ref lastChangeID);

Where lastChangeID is an empty string. This should give back results like

<ContentDatabase><Metadata ChangeId="1;0;146b129e-4f56-4701-ada2-b370744f2ca3;633896405160170000;168811216" ID="{146b129e-4f56-4701-ada2-b370744f2ca3}" /></ContentDatabase>

Where 146b129e-4f56-4701-ada2-b370744f2ca3 is the guid of my ContentDb The ChangeId mentioned here can be used in place of the lastChangeId and currentChangeId. My results appeared like

<SPContentDatabase Change="Unchanged" ItemCount="0">
<ContentDatabase><Metadata ChangeId="1;0;146b129e-4f56-4701-ada2-b370744f2ca3;633896953296070000;30349699" ID="{146b129e-4f56-4701-ada2-b370744f2ca3}" /></ContentDatabase></SPContentDatabase>

The process is exactly the same when using SiteDataService.ObjectType.Site

查看更多
登录 后发表回答