Aşağıdaki gelen xml yapısını pars etme konusunda yardıma ihtiyacım var ücretli ücretsiz yardımlarınızı bekliyorum.
Dönen Örnek XML Yapısı
<SONUC> <BEKLEYEN>5329998877,5338887766</BEKLEYEN> <ILETILEN>5459998877</ILETILEN> <HATALI>5006665544</HATALI> </SONUC>Örnek Php kodu
<?php
set_time_limit(0);
ini_set('mysql.connect_timeout', 600);
ini_set('default_socket_timeout', 600);
function sendRequest($site_name,$send_xml,$header_type=array('Content-Type: text/xml'))
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$site_name);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$send_xml);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPHEADER,$header_type);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
$result = curl_exec($ch);
return $result;
}
$xml = "
<RAPOR>
<oturum>
<kullanici>Kullanıcı adı</kullanici>
<sifre>Şifre</sifre>
</oturum>
<rapor>
<raporid>Mesaj gonderimi sirasinda gelen ok cevapli id...</raporid>
</rapor>
</RAPOR>";
$gonder = sendRequest("https://e-toplusms.com/api/xml_rapor.php",$xml);
?>