I am trying to add a post to ektron cms from another web application.
for this I first created a blog folder into cms making use of new myapplication.EktronBlogService.BlogSoapClient().AddBlog()
here is the code I used.
AuthenticationHeader header= new AuthenticationHeader();
header.Username = "admin";
header.Password = "admin";
RequestInfoParameters rqInfo = new RequestInfoParameters();
string[] categories = new string[] { "technology", "astronomy" };
BlogVisibility Bvisibility= new BlogVisibility();
BlogRoll bRoll= new BlogRoll();
rqInfo.ContentLanguage= 1033;
myapplication.EktronBlogService.BlogSoapClient obj= new BlogSoapClient();
obj.AddBlog(header, rqInfo, parentFolderId, "Blog-Namehere", "BlogTitleHere", "BlogDescriptionHere", bVisibility, true, true, true, categories, bRoll);
On doing the above I was able to successfully create the blog folder in the ekton workarea uder the parent folder which I mentioned.
Now am trying to create a post in the newly created blog folder by making use of
ContentData cData= new ContentData();
cData.Text="Post content";
cData.Title="Post Title";
//newBlogID=8589936489
long response= obj.AddPost(header, rqInfo, 8589936489, cData, categories,true, "MyTag", "www.XYZXYZXYZ.com" );
but I got an exception as below
System.Web.Services.Protocols.SoapException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at Ektron.Services.Blog.AddPost(Int64 blogID, ContentData PostContent, String[] Categories, Boolean Pingback, String Tags, String TrackbackURL)
source error as below
Line 7607: [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] Line 7608: MyApplication.EktronBlogService.AddPostResponse MyApplication.EktronBlogService.BlogSoap.AddPost(MyApplication.EktronBlogService.AddPostRequest request) { Line 7609: return base.Channel.AddPost(request); Line 7610: } Line 7611: