ASMX Task Scheduler on Godaddy
I am trying to call my webservice (asmx) every hour. Asmx is on my shared hosting with Godaddy.
Godaddy uses Powershell v1.0. They have an example on their support page: http://support.godaddy.com/help/article/8970/scheduling-tasks-with-plesk-shared-hosting?pc_split_value=2&countrysite=ca
I went out of my depth and don't see what they are actually doing in this example. It seems to be calling downloadstring on aspx, but I don't understand why you would want to schedule just that?
I copied the powershell script from here: http://poshcode.org/1339
and created my own two lines script that calls my asmx function which has no inputs:
$page = .\New-WebServiceProxy.ps1 -Url http://www.mysite.co.uk/myasmx.asmx -Anonymous
$page.sendEmail
This code is loaded into the root directory along with the web service.
I tried to run this, but the installation script ("email.ps1") doesn't work. I am not sure if I am using the correct path since its not clear which path I should be using.
I know the function in asmx works because I can call it directly in the browser and it works fine.
I also tried to use my code almost as is, but replacing this code:
-c "(new-object system.net.webclient).downloadstring('http://[domain.tld]\[path]\[file_name]')"
with this:
-c "(new-object system.net.webclient).uploadstring('http://www.mysite.co.uk\httpdocs\myasmx.asmx/SendEmail', '')"
It was despair. I also tried using the path G: \ PleskVhosts [domain.tld] [path] [filename] which is specific in the PHP example, but that doesn't work either.
Can anyone tell me where I am going wrong or point me in the right direction.
BTW, I know about expireCache expiration for those using shared hosting. I saw the blog http://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/ and this is my backup plan, but I need the call to be regular and not know how to get the app start again if closed.
source to share
Check backslash:
Here's an example of a dad:
' http://www.mysite.co.uk \ httpdocs \ myasmx.asmx / SendEmail'
Use a forward slash instead of a backslash and the scheduled task will run normally.
source to share