$debug = 0;$usr = 'username';
$pwd = 'password';
$WSDL_URL = 'https://webservice2.dmz.mycompany.com';
ini_set('soap.wsdl_cache_enabled', 0);
ini_set('soap.wsdl_cache_ttl', 0);
$so_init = array(
'login' => $usr,
'password' => $pwd,
'trace' => $debug,
'exceptions' => $debug,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // enable for easier responses in PHP
);
$so_client = new SoapClient($WSDL_URL, $so_init);
// you may need this line if your WSDL has incorrect hostnames
// $WSDL_Action = 'https://webservice2.dmz.mycompany.com';
// $so_client->__setLocation($WSDL_Action);
// view methods
// print_r($so_client->__getFunctions(), 1);
// invoke a method
$params = array('Username' => 'Bob');
$so = $so_client->MyMethod($params);
// view result
print_r($so, 1); |