Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Soapclient-test
<?php
$client = new SoapClient('http://www.webservicex.net/whois.asmx?WSDL');
$method = 'GetWhoIS';
$args = array('HostName' => 'reeze.cn');
var_dump($client->GetWhoIS(array('HostName' => 'reeze.cn')));
var_dump(call_user_func(array($client, $method), $args));
$reflectionMethod = new ReflectionMethod($client , $method);
var_dump($reflectionMethod->invokeArgs($client , $args));
@reeze
Copy link
Author

reeze commented Sep 19, 2012

@reeze
Copy link
Author

reeze commented Sep 19, 2012

Result:

object(stdClass)#2 (1) {
  ["GetWhoISResult"]=>
  string(398) "Domain Name: reeze.cn
ROID: 20090705s10001s87709460-cn
Domain Status: ok
Registrant ID: c-x-57536-12951
Registrant: ?????????
Registrant Contact Email: reeze.xia@gmail.com
Sponsoring Registrar: ??????????????????????????????????????????
Name Server: namerich1.dnspod.net
Name Server: namerich2.dnspod.net
Registration Date: 2009-07-05 15:59:55
Expiration Date: 2015-07-05 15:59:55
DNSSEC: unsigned
"
}
object(stdClass)#2 (1) {
  ["GetWhoISResult"]=>
  string(398) "Domain Name: reeze.cn
ROID: 20090705s10001s87709460-cn
Domain Status: ok
Registrant ID: c-x-57536-12951
Registrant: ?????????
Registrant Contact Email: reeze.xia@gmail.com
Sponsoring Registrar: ??????????????????????????????????????????
Name Server: namerich1.dnspod.net
Name Server: namerich2.dnspod.net
Registration Date: 2009-07-05 15:59:55
Expiration Date: 2015-07-05 15:59:55
DNSSEC: unsigned
"
}
PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Method SoapClient::GetWhoIS() does not exist' in /Users/reeze/Opensource/php-test/php-src-5.3/a.php:11
Stack trace:
#0 /Users/reeze/Opensource/php-test/php-src-5.3/a.php(11): ReflectionMethod->__construct(Object(SoapClient), 'GetWhoIS')
#1 {main}
  thrown in /Users/reeze/Opensource/php-test/php-src-5.3/a.php on line 11

Fatal error: Uncaught exception 'ReflectionException' with message 'Method SoapClient::GetWhoIS() does not exist' in /Users/reeze/Opensource/php-test/php-src-5.3/a.php:11
Stack trace:
#0 /Users/reeze/Opensource/php-test/php-src-5.3/a.php(11): ReflectionMethod->__construct(Object(SoapClient), 'GetWhoIS')
#1 {main}
  thrown in /Users/reeze/Opensource/php-test/php-src-5.3/a.php on line 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment