Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • julius 107 posts 289 karma points
    Oct 05, 2011 @ 12:40
    julius
    0

    Access umbraco from a Windows service?

    Would this be possible and what would be needed to access our Umbraco installation from a Windows service? We need to perform some automated tasks, like publishing and unpublishing certain articles based on a number of parameter and we need to do this daily.

  • Rodion Novoselov 694 posts 859 karma points
    Oct 05, 2011 @ 12:50
    Rodion Novoselov
    0

    Of course you can. Windows Service can access your installation for example via Web Services / WCF / etc exactly like any other application.

  • julius 107 posts 289 karma points
    Oct 05, 2011 @ 13:09
    julius
    0

    Ok, thanks.

    I read up a little on WCF and I understand this is a framework that facilitates communication between programs on the same computer. Is WCF the way of doing this or would there be alternatives to the WCF approach?

    I haven't tried yet, but what would happen if I include the Umbraco dlls in my current Windows service project and, for example, call Node.GetCurrent()? Since there is no 'current' node from the perspective of a web service, I was wondering what would happen.

    I am really just at the stage of trying to understand the concepts and requirements. I am a Java developer that has just switched to Windows/.Net.

     

    Thanks!

  • Rodion Novoselov 694 posts 859 karma points
    Oct 05, 2011 @ 13:30
    Rodion Novoselov
    0
     this is a framework that facilitates communication between programs on the same computer.

    No way - to be short, WCF is a framework that supersedes the features of .NET Web Services, .NET Remoting and WSE. It's by no mean limited to a single computer interprocess communications. Sometimes, however, it's simpler to use plain web services (*.asmx) - it depends.

    I haven't tried yet, but what would happen if I include the Umbraco dlls in my current 
    Windows service project and, for example, call Node.GetCurrent()? 

    Unfortunately, it's not possible to work with umbraco API this way. Internal implementation depends on existing of HttpContext in many places. Personally, I lack the ability to work with umbraco API like in SharePoint (SharePoint API is accessible from anywhere, not only from inside the web application itself) as well. If you need to call some API you should place your code inside a web service or a web page that runs inside an umbraco application. 

  • julius 107 posts 289 karma points
    Oct 05, 2011 @ 14:10
    julius
    0

    [quote]Unfortunately, it's not possible to work with umbraco API this way.[/quote]

    So that would mean I have to call a certain url inside my Umbraco web application from my Windows service? I was wondering if I could use the Umbraco library directly from my service, but I guess that isn't possible. Or perhaps it is with Courier 2? I know Courier 2 gives you command line access to the Umbraco, but I am not sure what kind of things you can do from the command line.

     

    [quote]No way - to be short, WCF is a framework that supersedes the features of .NET Web Services[/quote]

    I see, but could you tell me how WCF would help me accomplish my goal: publish and unpublish certain articles, twich a day, at predefined times, from a Windows service?

  • Rodion Novoselov 694 posts 859 karma points
    Oct 05, 2011 @ 14:29
    Rodion Novoselov
    0

    There's a good article including samples of code and so on there:

    http://our.umbraco.org/wiki/codegarden-2009/codegarden09-sessions/the-box/using-webservices-in-umbraco

  • Taras 30 posts 151 karma points
    Oct 02, 2013 @ 11:40
    Taras
    0

    I have a same question.

    Can I connect to umbraco from Windows Service without WebService?

    My task:I have website with umbraco and I need periodically change some node's property.I must define new value of property using node's url. How can I do it?

    Thanks.

  • Taras 30 posts 151 karma points
    Oct 02, 2013 @ 18:10
Please Sign in or register to post replies

Write your reply to:

Draft