Merhaba arkadaşlar. Aras kargonun http://customerws.araskargo.com.tr/arascargoservice.asmx?WSDL servisini kullanarak kargo kaydı oluşturmak istiyorum. Soap ile yapılıyormuş ve benim bu konuda hiç bir bilgim yok. Kaç gündür bununla ilgili bilgi veya örnek dosya aramaktayım herhangi bir bilgiye neredeyse ulaşamadım. Aras kargonun paylaştığı setorder işlemleri için https://customerws.araskargo.com.tr/arascargoservice.asmx?op=SetOrder bilgiler mevcut ama bunu nasıl kullanacağım hakkında bir bilgim yok. Araştırdığım kadarıyla bir kaç satır oluşturdum ama işe yaramadı. <?php /** Aras Kargo **/ $siparisno = 12356; $alici = "Alıcı adı"; $siparisno = "1111111"; $adres = "ADRES"; $il = "Sipariş ili"; $ilce = "Sipatiş ilçe"; $tel = 0000000000; $agirlik =2; $koli = 1; $user_name = 'neodyum'; $user_pass = 'nd2580'; $service_url = 'http://customerservicestest.araskargo.com.tr/arascargoservice/arascargoservice.asmx?WSDL'; $order = array( "UserName" => $user_name, "Password" => $user_pass, "TradingWaybillNumber" => $siparisno, "InvoiceNumber" => $siparisno, "IntegrationCode" => $siparisno, "ReceiverName" => $alici, "ReceiverAddress" => $adres, "ReceiverCityName" => $il, "ReceiverTownName" => $ilce, "ReceiverPhone1" => $tel, "PayorTypeCode" => 1, "IsCod" => 0, //'Tahsilatlı (0=Hayır, 1=Evet) "PieceCount" => $koli, "CodCollectionType" => 0, //0-Nakit,1-Kredi Kartı "CodAmount" => $agirlik, "IsWorldWide" => 0,// (0=Yurtiçi, 1=Yurtdışı) ); error_reporting(1); @ini_set("soap.wsdl_cache_enabled", "0"); $send['orderInfo']['Order'] = array($order); $send['userName'] = $user_name; $send['password'] = $user_pass; $response = getSOAP($service_url, 'setOrder', $send ); if(isset($response['SetOrderResult']) ) { if(isset($response['SetOrderResult']['OrderResultInfo'])){ if($response['SetOrderResult']['OrderResultInfo']['ResultCode']==0){ $this->result['status'] = 1; echo' Kargo Kaydı Açıldı';
} else{ $this->result['status'] = 0; echo $response['SetOrderResult']['OrderResultInfo']['ResultMessage'];
}
} else{ echo 0; echo '102'; }
$response['ShippingOrderResultVO']['jobId']; } else { echo 0; echo '102'; } $service_method = "setOrder"; function getSOAP($service_url, $service_method, $send ){ if (!extension_loaded('soap')) { throw new Exception('SOAP requests is unavailable'); } try{ if($_GET['siparisno']){ echo "<br>Servis Endpoint: $service_url<br>\r\n<pre>"; echo "<br>Request data:<br>\r\n<pre>"; print_r($send); } $client = new SoapClient($service_url, array('trace' => 1, 'exceptions' => 1)); $response = $client->$service_method( $send ); if($_GET['siparisno']){ echo "<br>Response data:<br>\r\n<pre>"; print_r($response); } return json_decode(json_encode($response),1); } catch(Exception $e) { if($_GET['siparisno']){ echo "<br>Exception data:<br>\r\n"; print_r($e->getMessage()); } echo 'Kargo Servislerine Bağlanılamadı. Lütfen tekrar deneyiniz. <br>'.$e->getMessage(); }
} ?> |
_____________________________
İmzanız kural dışıdır! || Uymanız gereken imza kurallarını okumak için tıklayınız.
|