/* SOAP İşlemleri */
ini_set('soap.wsdl_cache_enabled',0);
ini_set('soap.wsdl_cache_ttl',0);
$WSDLAdres = 'https://siteadi.com/Sunucu.php?wsdl';
class NTGIstemci extends SoapClient
{
public function __construct()
{
extract($GLOBALS);
parent::__construct($WSDLAdres, array(
'location' => $WSDLAdres,
'uri' => $WSDLAdres,
'style' => SOAP_RPC,
'use' => SOAP_ENCODED,
'soap_version' => SOAP_1_2,
'authentication'=> SOAP_AUTHENTICATION_DIGEST,
'ssl' => array(
'ciphers'=> "SHA1",
'verify_peer' => false,
'allow_self_signed' => true
),
'https' => array(
'curl_verify_ssl_peer' => false,
'curl_verify_ssl_host' => false
),
'cache_wsdl' => WSDL_CACHE_NONE,
'cache_ttl' => 86400,
'trace' => true,
'exceptions' => true,
'encoding' => 'utf-8',
'stream_context' => stream_context_create(array('http'=>array('user_agent' => 'NTGSoap'))),
'compression' => (SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP),
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
"connection_timeout" => 7
));
}
/* PHP SOAP MTOM */
public function __doRequest($request, $location, $action, $version, $one_way = 0)
{
$response = parent::__doRequest($request, $location, $action, $version, $one_way);
$start=strpos($response,'<soap');
$end=strrpos($response,'>');
$response_string=substr($response,$start,$end-$start+1);
return($response_string);
}
}
try {
$snc=new SoapServer($WSDLAdres, array(
'location' => $WSDLAdres,
'uri' => $WSDLAdres,
'style' => SOAP_RPC,
'use' => SOAP_ENCODED,
'soap_version' => SOAP_1_2,
'authentication'=> SOAP_AUTHENTICATION_DIGEST,
'ssl' => array(
'ciphers'=> "SHA1",
'verify_peer' => false,
'allow_self_signed' => true
),
'https' => array(
'curl_verify_ssl_peer' => false,
'curl_verify_ssl_host' => false
),
'cache_wsdl' => WSDL_CACHE_NONE,
'cache_ttl' => 86400,
'trace' => true,
'exceptions' => true,
'encoding' => 'utf-8',
'stream_context' => stream_context_create(array('http'=>array('user_agent' => 'NTGESoap'))),
'compression' => (SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP),
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
"connection_timeout" => 7
));
$snc->setClass('NTGIstemci');
$snc->handle();
}catch(SoapFault $e) {
if(!$dosya = fopen('hatalar.log', 'a+')) die('Dosyayı Yazamadım !');
fwrite($dosya, print_r($e, true)."\r\n----------------------------------------------------------------------------------\r\n");
fclose($dosya);
echo $exc->getTraceAsString();
}