2014-05-18 6 views
0

XML을 성공적으로 파싱하려면 PHP로 도움을 받으시겠습니까? 그게 내 문제 야. 전선에서 XML을 얻었지만 PHP는 파싱하지 않습니다.PHP를 사용하여 SOAP로 배열 보내기

PHP-SOAP/5.2.17도 PHP-SOAP/5.1.6도 PHP 5.3에서는 아직 시도하지 않았습니다.

<?PHP 
echo "<html><body>\n"; 
echo "starting<br>\n"; 
echo "<pre>\n"; 

$wsdl = "http://192.168.16.7/api/soap/softswitch.wsdl"; 
ini_set("soap.wsdl_cache_enabled", "0"); // disable WSDL cache 
$client = new SoapClient($wsdl, array('trace'=>true, 'exceptions'=>true)); 

try { 
$response = $client->get_queue_destinations($_REQUEST['username'], 
$_REQUEST['password'], $_REQUEST['queue']); 

# echo "$response"; 

print_r($response); 
# var_dump($response); 

$x = serialize($client->__getLastResponse()); 
print_r($x); 

#$xml = simplexml_load_string($client->__getLastResponse()); 
#print_r($xml); 

# print "Request: \n".htmlentities($client->__getLastRequest()) ."\n"; 
# print "Response: \n".htmlentities($client->__getLastResponse())."\n"; 
# echo "</pre>\n"; 

} catch (Exception $e) { 
echo "<pre>\n"; 
echo "Caught Exception: " . $e->getMessage() . "\n"; 
// Show the actual XML sent and received 
print "Request: \n".$client->__getLastRequest() ."\n"; 
print "Response: \n".$client->__getLastResponse()."\n"; 
echo "</pre>\n"; 
} 

echo "</pre>\n"; 
echo "finished\n"; 
echo "</body><html>\n"; 

?> 

답변

0
  1. 방문 http://us2.php.net/serialize

#$xml = simplexml_load_string($client->__getLastResponse()); 
#print_r($xml); 

간단한 XML 객체이며이 그런 식으로 인 print_r 수 없습니다 "기능을 직렬화하는 XML 파싱에 사용할 수 없습니다."

관련 문제