spEvalLists.GetListItems - Not returning pdf documents uploaded  
Author Message
Sumal





PostPosted: .NET Framework Networking and Communication, spEvalLists.GetListItems - Not returning pdf documents uploaded Top

Hi

I wonder if anyone can help with a problem. Im kind of new ant this.

We have a document sync process to synchronize the documents uploaded in two separate SharePoint instance. This is a scheduled process, would query against Source SharePoint site and get updated document and details. We are using HttpWebRequest, PUT method to physically move the document to destination SharePoint instance. Then we are using GetListItems() against the destination SharePoint site to get the details of the uploaded file. Later using UpdateListItems() to update the properties for the last file moved.

My issue is, when I use GetListItems(), I am not getting the details of the last uploaded .pdf files. To confirm this, I uploaded and synchronized .doc files and everything is working fine. This was working fine till last week. I have similar document libraries and the same process is working fine for all file types.

The Code:

HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(destUri.AbsoluteUri);

request.Credentials = this.TargetCredentials;

//CredentialCache.DefaultCredentials;

request.Headers.Add("Translate","f");

request.ContentLength = contentLength;

request.ContentType = "application/octet-stream";

request.Method = "PUT";

//When using a PUT Method, send the stream for the item as the request body

Stream reqStream = request.GetRequestStream();

byte[] b = new byte[4096];

int bytesRead = sourceStream.Read(b, 0, b.Length);

while(bytesRead > 0)

{

reqStream.Write(b, 0, bytesRead);

bytesRead = sourceStream.Read(b, 0, b.Length);

}

sourceStream.Close();

reqStream.Flush();

// Send the request.

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

//Get all list items in my document library ('Document Library' in this case we only put it there)

XmlNode node = spEvalLists.GetListItems( documentLibrary,null, null, null, null, null);

string fileName = System.Web.HttpUtility.UrlDecode(destination.Segments[destination.Segments.Length - 1]);

//Find the node I want to edit, which I am selecting by file name (Publisher.doc)

//This file's Sharepoint ID is needed for the update call, so read it into a variable

int id = int.Parse(documentNode.Attributes["ows_ID"].Value);

…..

XmlNode results = spEvalLists.UpdateListItems(documentLibrary, doc.DocumentElement);

Any help would really be appreciated.



.NET Development24