Jump to content

PHP & SOAP efficiency - help with small code please


iCeR

Recommended Posts

I connect up to a domain API and perform an availability check on only one domain.

 

    * I would like to loop this 10 times, in the most efficient way to check for any changes in status

    * I would like it to do the checks as quickly as possible (reduce the time between checks)

    * I would like it to ouput each time it completes a check (if a multiple loop is in place it only outputs all checks once finished, in one go, rather than one at a time after each check / iteration in the loop)

 

Cheers!

 

   <?php

    // connection credentials and settings
    $location = 'https://TheApiServiceURL.com/';
    $wsdl = $location.'?wsdl';
    $username = 'APIuser';
    $password = 'APIpass';

    // include the console and client classes
    include "class_console.php";
    include "class_client.php";

    // create a client resource / connection
    $client = new Client($location, $wsdl, $username, $password);

    /**
    * Example usage and output results to screen
    */

    // Example #1: Check domain name availability
    print('========== consoleMethod[domainLookup] ==========<br/>');
    $client-­‐>set('domain', 'domain.com');
    $client-­‐>domainLookup();
    $client-­‐>screen($client-­‐>response());
    $client-­‐>unset('domain');

    ?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.