Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8982323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:33:03+00:00 2026-06-15T20:33:03+00:00

Hie..I want help on a cakePHP script that will refresh or call a function

  • 0

Hie..I want help on a cakePHP script that will refresh or call a function in the controller after specified time interval.

public function testwebservices(){
    ini_set("soap.wsdl_cache_enabled","0");  
    $options = array( 
    'soap_version'=>SOAP_1_2,           
    'exceptions'=>true,                 
    'trace'=>1,                     
    'cache_wsdl'=>WSDL_CACHE_NONE       
);
$wsdl = "http://example.com/service.asmx?wsdl";
$client = new SoapClient($wsdl,$options);
$lastrec = rec5000;         
$rec = $client->GetReceipt(array('txnRef'=>$lastrec));
$result = $rec->GetReceiptRez;

i want to call the above function to so that it will be automatically executed after a specified time.

Thank you in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:33:04+00:00Added an answer on June 15, 2026 at 8:33 pm

    You’re best bet is to go with a cron-task (if you’re on a Unix/Linux machine). The cron task could be written in a couple of ways.

    First: You could call your script directly with the PHP interpreter and the script you’d run in your cron may look like

    #!/bin/sh
    /path/to/php /full/path/to/script.php
    

    However, you’ll need to take notice that you will not get the benefits of your framework. That means that any framework utilities that you are using, you will have to load yourself in your script.php file. If this is too much (loading all the required utils), then you can do it another way.

    Second: You can create an endpoint, such as /test/web-service and you can setup a cron to make a web-request to that script which will check that the web service is running correctly. In that case you would have a simply cURL request that might look like:

    #!/bin/sh
    curl http://mysite.com/test/web-service
    

    The benefit of this approach is that you could really put this on any machine (if you make the URL public) and you get the benefit of having your framework (cakePHP in this case) being loaded and all of the utils being available to you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hie, i want to listen when a certain application after listening i want to
Hie guys i need help with my code. I have a form where a
Hie Everyone I have 1st time developed SSRS in my WPF application.. but there
hie all, i want to insert the data into the table only if the
Hie, I am new to VTK.I want to use QVTKPluginWidget in Qt designer. I
Hie guys i am still learning cakephp so this question might be easy but
Hie Everyone I am designing a webpage with a fluid layout. I want to
Hie guys i want to create a random string of numbers where there is
Hie all , I am trying to create an simple application and i want
Hie all , is there any method in android that can differentiate the left

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.