Use WCF for create a News
How can I use ~/sitefinity/Services/Content/NewsItemmService.svc Your WCF client example (VS 2010 solution) conyains only list and delete news methods.
for create and update a news?
The documentation on this is pretty useless.
How do I know which fields are required in the passed JSON?
And how do I know what values I can / should I use?
How can I publish/unpublish the news?
Besides the 4.1 SP2 I was able to insert a news (in the draft and was blocked by the user),
but the same code no longer works on 4.3, despite the inclusion of various "PersistedValue": "my string","Value": "my string" instead of simple strings.
I am using this JSON:
"Item":
"AllowComments":false,
"AvailableLanguages": ["it"],
"DateCreated":"\/Date(1321007676307)\/",
"PublicationDate": "\/Date(1321007676307)\/" ,
"Title":"PersistedValue": "Test 1", "Value": "Test 1" ,
"UrlName":"PersistedValue": "Test-1", "Value":"Test-1" ,
"Author":"PersistedValue": "Test page", "Value":"Test page" ,
"Content":"PersistedValue": "Lorem ipsum...", "Value":"Lorem ipsum..." ,
"Summary":"PersistedValue": "", "Value":""
And the error (not present in previous Sitefinity version) is:
String was not recognized as a valid Boolean.
Where can I see a working example?
Alessandro
I would also like to see some answers on this question.
Hi guys,
I'm attaching an example of creating a News Item, using Sitefinity's services. Mind that you have to specify credentials of a user that has create/edit permissions for news items, so that the service can be consumed. You can also check this blog post for more general information on Sitefinity's RESTful services:
http://www.sitefinity.com/blogs/svetlayankova/posts/11-11-01/getting_started_with_restful_services_in_sitefinity.aspx
Considering the required fields - they are the same as they would be if you created a NewsItem from the backend. It should have a Title, UrlName, Content, PublicationDate and an Author. Considering the error that is thrown to you, I think the reason is this line:
"AllowComments":false,