We need to fetch som data from an external API and present the data on a Umbraco page.
How would you recomend doing that. Is it possible the make a scheduled job runnning every night, fetching the data and the present i at a page on the site?
Depending on the data you could use CMSImport to get the data. The pro version allows you to schedule jobs. If the format is not generic you could write your own Data provider. Find more info on our website http://soetemansoftware.nl/cmsimport
We run a nightly update on our websites that update the Umbraco CMS using the built in Content Service and an external web service. Currently this is accessed via a standard.aspx page placed in the Umbraco directory but we are looking at porting it over to using WebApi. There is a built in scheduler in Umbraco which you could get to periodically run a method within WebApi to trigger the update but in my experience the Umbraco scheduler is unreliable particularly if your IIS server does not keep your website in scope under periods of low traffic. The alternative we use therefore is to setup a scheduled task on our web server that calls our .aspx page (or WebApi) which then triggers the update.
The code that fetches data is essentially just a service reference to a WSDL which in Visual Studio becomes a useable object. You can then use this object and its property values to retrieve content / data which you can then input into Umbraco using the ContentService.
Unfortunately the examples I have at the moment are confidential but I can try and put and example using a web service that is available on the web at some point.
Hej, Jason.
Maybe you still have this code and you can share it?
This post are first in Google, so maybe solution for those who are looking for this solution are the best to share? :)
Maybe not exactly, but edited version to hide companies confidential information? :)
Below the xml file and media folders I use to import from xml. To test this, put the media folders img and files in the root of your umbraco installation with CMSImport pro installed. If you don't have a license please send an email to [email protected] with the domain you want to test it on and I create a trial license for you.
This could be a nice test. But it's best to test against the xml returned from the service since xml can be very generic. And also because the media reference is propably not the same as in the sample I send you. Most clients I worked with that consume services wrote their own Dataprovider to tweak the xml and downloading of images etc.
Fetching data from external source
Hey
We need to fetch som data from an external API and present the data on a Umbraco page.
How would you recomend doing that. Is it possible the make a scheduled job runnning every night, fetching the data and the present i at a page on the site?
/Jacob
Hi Jacob,
Depending on the data you could use CMSImport to get the data. The pro version allows you to schedule jobs. If the format is not generic you could write your own Data provider. Find more info on our website http://soetemansoftware.nl/cmsimport
Best,
Richard
Richard Soeteman: Nice. I will try the Free edition first. If it works you got at new customer :)
Great to hear! Thanks and please let me know when you have any questions.
Hej Richard
Its it possible to see at example of a XML-filen including images that your system can import?
Hi Jacob,
We run a nightly update on our websites that update the Umbraco CMS using the built in Content Service and an external web service. Currently this is accessed via a standard.aspx page placed in the Umbraco directory but we are looking at porting it over to using WebApi. There is a built in scheduler in Umbraco which you could get to periodically run a method within WebApi to trigger the update but in my experience the Umbraco scheduler is unreliable particularly if your IIS server does not keep your website in scope under periods of low traffic. The alternative we use therefore is to setup a scheduled task on our web server that calls our .aspx page (or WebApi) which then triggers the update.
Cheers,
Jason
Jason: Do your have an example of the code fetching data?
Hi Jacob,
The code that fetches data is essentially just a service reference to a WSDL which in Visual Studio becomes a useable object. You can then use this object and its property values to retrieve content / data which you can then input into Umbraco using the ContentService.
Unfortunately the examples I have at the moment are confidential but I can try and put and example using a web service that is available on the web at some point.
Cheers,
Jason
Hej, Jason. Maybe you still have this code and you can share it? This post are first in Google, so maybe solution for those who are looking for this solution are the best to share? :) Maybe not exactly, but edited version to hide companies confidential information? :)
Hi Jacob,
Sure do you need to schedule things or can your customer upload a file and images in a zip file?
@Jason I'm about to release CMSImport V3 where the scheduled task is inside a httpmodule much more reliable than first.
Best,
Richard
Need to schedule it using a external service returning XML.
Hi Jacob,
Below the xml file and media folders I use to import from xml. To test this, put the media folders img and files in the root of your umbraco installation with CMSImport pro installed. If you don't have a license please send an email to [email protected] with the domain you want to test it on and I create a trial license for you.
https://www.dropbox.com/sh/y0w13ch3bbjhhpp/AACTuvtu7v0Z3oE0yq38cR8Za?dl=0
This could be a nice test. But it's best to test against the xml returned from the service since xml can be very generic. And also because the media reference is propably not the same as in the sample I send you. Most clients I worked with that consume services wrote their own Dataprovider to tweak the xml and downloading of images etc.
Best,
Richard
is working on a reply...