PHP & SOAP efficiency - help with small code please

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
iCeR
Forum Newbie
Posts: 5
Joined: Tue Feb 08, 2011 9:29 am

PHP & SOAP efficiency - help with small code please

Post by iCeR »

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!

[text]<?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');

?>[/text]
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: PHP & SOAP efficiency - help with small code please

Post by Jade »

The purpose of this forum isn't to get other people to do your work for you. It's to help people who are learning and get stuck in the process. If you want to help for free this should go in the volunteer section. If you're willing to pay for the help it should go in the jobs section.

This will get you pointed in the right direction if you want to try it yourself: http://www.w3schools.com/php/php_looping_for.asp
Post Reply