create news from my web application - General Discussions - General Discussions - Progress Community
 General Discussions

create news from my web application

  • create news from my web application
  • I need to create news in sitefinity database from my web application,

    can I use web services to do this?

    for example:
    var usersService = new WebChannelFactory<IUsers>("mysite.it/.../UserProfileTypesService.svc");
                var usersChannel = usersService.CreateChannel();
                var auth = usersChannel.AuthenticateUser(new Telerik.Sitefinity.Security.Credentials() UserName = "user", Password = "password", Persistent = true );

    EndpointAddress address = new EndpointAddress("mysite.it/.../");
    What is the News Interface to insert in ChannelFactory ?

    Or is it better to use newManager?
    for example:
    NewsManager newsManager = new NewsManager("News");
    NewsItem newsItem = newsManager.CreateNewsItem();

    In this case how can I connect to sitefinity database?


    thanks!


  • Hello Paolo,

    It is not very easy to create news items using our services, so I can recommend you to use either the Fluent or Native API. If you correctly write the code it will create all necessary records in the database. Please consult the following article:

    http://www.sitefinity.com/40/help/developers-guide/sitefinity-essentials-modules-news-creating-news-items.html

    Greetings,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Hello Victor,
    Allthough it may not be very easy to create news using the web services, is it possible? For someone who is skilled with JSON/WCF and other scripting languages, it may be easier for them to use web services than learning and implementing the API's.

    If it is possible, can you help me find a sample of HTTP Push to NewsItemService.svc that creates a News Item.

    Thanks,
    Dave
  • Hello David,

    Please refer to the following article to create a news item through our rest service: www.sitefinity.com/.../getting_started_with_restful_services_in_sitefinity

    Here is an additional link that you may find useful: www.sitefinity.com/.../working-with-restful-services-part-2-claims-authentication-and-designing-service-calls

    Regards,
    Lilia Messechkova
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items