2013-11-21 100 views
1

當我嘗試發送此請求,然後我得到錯誤「ID:0 500內部服務器錯誤 - SoapFault」。Symfony 2 + SoapClient

我的要求:

$client = new SoapClient('xxx', array('trace' => 1)); 
$client -> soap_defencoding = 'utf-8'; 
$client -> decode_utf8 = FALSE; 
$a = array('user_name' => 'xx', 'user_password' => 'xx'); 
$response = $client->__soapCall('adeLogin', $a); 
$session = get_object_vars($response)['session']; 

$aCPrep = array(
'rname1' => 'Pan', 
'rname2' => 'Jan', 
'rname3' => 'test', 
'rcountry' => 'PL', 
'rzipcode' => '00-950', 
'rcity' => 'Warszawa', 
'rstreet' => 'ul. Kwieciska 15', 
'quantity' => '1',  
'rphone' => '1500-100-900', 
'rcontact' => 'Antoni', 
'weight' => '100', 
'date' => '2012-01-01', 
'references' => 'by WebAPI ', 
'notes' => 'by Thomi (thest 4)', 
'srv_ade' => 'asd', 
'pfc' => 'Magazyn', 
'sendaddr' => array('name1' => 'Firma z Francji', 'name2' => 'firma', 'name3' => 'firma2','country' => 'FR', 'zipcode' => '14117', 'city' => 'Arromanches', 'street' => 'Pl. du Six Juin 1944'), 
'srv_daw' => array('name' => '','building' => '','floor' => '','room' => '','phone' => '','altrec' => ''), 
'srv_ident' => array('name' => '','country' => '','zipcode' => '','city' => '','street' => '','nation' => '','date_birth' => '','identity' => '','ident_doctype' => '','spages' => '','ssign' => '','sdealsend' => '','sdealrec' => ''), 
'srv_ppe' => array('sname1' => '','sname2' => '','sname3' => '','scountry' => '','szipcode' => '','scity' => '','sstreet' => '','sphone' => '','scontact' => '','rname1' => '','rname2' => '','rname3' => '','rcountry' => '','rzipcode' => '','rcity' => '','rstreet' => '','rphone' => '','rcontact' => '','references' => '','weight' => ''), 
'srv_bool' => array('cod' => '1', 'cod_amount' => '200', 'exw' => '0', 'rod' => '0', 'pod' => '0', 'exc' => '0','ident' => '0','daw' => '0','ps' => '0','pr' => '0','s10' => '0','s12' => '0','sat' => '0','ow' => '0','srs' => '0',), 
'parcels' => array('0' => array('weight' => '15', 'reference' => 'paczka duza','number' => '','srv_ade' => '', 'srv_bool' => array('cod' => '1', 'cod_amount' => '200', 'exw' => '0', 'rod' => '0', 'pod' => '0', 'exc' => '0','ident' => '0','daw' => '0','ps' => '0','pr' => '0','s10' => '0','s12' => '0','sat' => '0','ow' => '0','srs' => '0'))) 
); 

$aCMsg = array('session' => $session, 'consign_prep_data' => $aCPrep); 
$aClient = $client->__soapCall('adePreparingBox_Insert', $aCMsg); 

這是錯誤從我的SOAP服務器或symfony的?任何人都知道什麼是錯的?

如何顯示XML?

回答

0

它是從SOAP服務器 響應嘗試

echo "REQUEST:\n".$client->__getLastRequest()."\n"; 
echo "RESPONSE:\n".$client->__getLastResponse()."\n";