Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

Error editing discussion board item created by web services

$
0
0

I use the following code to create discussion board items:

 

            Lists list = new Lists();

            list.Credentials = CredentialCache.DefaultCredentials;

            list.Url = siteurl + "/_vti_bin/Lists.asmx";

           

           byte[] encData_byte = System.Text.Encoding.UTF8.GetBytes(Guid.NewGuid().ToString() );    
          
  string threadIndex = Convert.ToBase64String(encData_byte);
            //For body

            string mime = "Message-ID: 99\n";

            mime += "Thread-Index: " + threadIndex + "\n";

            mime += "Subject: This is the topic\n";

            mime += "Mime-Version: 1.0\n";

            mime += "Content-type: text/plain; charset=us-ascii\n\n";

            mime += "This is the body of the topic\n";

 

            byte[] bytes = new byte[mime.Length];

            for (int i = 0; i < mime.Length; i++)

                bytes[i] = (byte)mime[i];

 

            list.AddDiscussionBoardItem("{your list Guid}", bytes);

This seems to work fine and I can see  the discussion board entry on my SharePoint site. However if I try to reply to the entry from SP site, I receive the following error when clicking 'ok' on reply 

Failed to get value of the "Thread Index" column from the "ThreadIndex" field type control. See details in log. Value does not fall within the expected range..

I have verified that the getGUID() correctly encodes to Base64

within the code the

ows_ThreadIndex="0x7B32303130313230322D303033....."

it is the correct hex representation of the GUID generated.

Any ideas?


Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>