SOAP & $client->__getTypes()

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
thegunner
Forum Newbie
Posts: 4
Joined: Thu Apr 02, 2009 4:52 am

SOAP & $client->__getTypes()

Post by thegunner »

Hi,

Im trying to make a soap connection and am using the following an example found on the web (http://www.usenet-forums.com/alt-comp-l ... https.html) which is:

require_once('lib/nusoap.php');
$proxyhost='http://myproxyserver';
$proxyport=8080;
$proxyusername='MY_NT_DOMAIN\thegunner';
$proxypassword='mypassword';

try {
$client = new SoapClient(
"https://www.secureach.com/CheckVerifyNo ... .asmx?WSDL", array('trace' => true), $proxyhost, $proxyport, $proxyusername, $proxypassword);
}

catch (SoapFault $sf) {
echo $sf->getMessage(), "\n";
}

echo "Types:\n";
foreach ($client->__getTypes() as $type)
echo $type, "\n";

echo "Functions:\n";
foreach ($client->__getFunctions() as $function)
echo $function, "\n";


But I get an error message:

Fatal error: Call to undefined method soapclient::__getTypes() in C:\wamp\www\client.php on line 23


Obviously I odn;'t seem to have this __getTypes() function in my nusoap.php......does anyone know what it should contain so I can insert it?...or know of any other reason why this error should be occurring?


Thanks,
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: SOAP & $client->__getTypes()

Post by requinix »

Not sure, but here's my guess:

You're behind a proxy, thus the $proxy variables. But the SoapClient constructor only takes two arguments: a URL and options. The rest will be ignored because PHP is nice like that. So SoapClient tries to get the URL and go into WSDL mode. But it can't because you're behind a proxy and didn't tell say how to get past it. So no WSDL mode. And since __getTypes is only valid in WSDL mode you get an error when trying to call it.

How's that sound?

You can probably download the WSDL definitions manually (you can configure cURL to pass through a proxy) then pass the downloaded file's name to SoapClient.
thegunner
Forum Newbie
Posts: 4
Joined: Thu Apr 02, 2009 4:52 am

Re: SOAP & $client->__getTypes()

Post by thegunner »

That's all sounds about right :)

Ok so I need to get past my proxy some other way...when I did some searhcing on the net for this, it mentioned about putting the proxy variables in the new SoapClient($wdsl,true......) section. Ok I'll have alook and see how I can do this alternatively - not unless you know


I was trying : $client->setUseCurl(1); - as this all it was using in the samples.
Post Reply