가능한 중복 : 이제다른 방법
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <LoginResult xmlns="http://Siddin.ServiceContracts/2006/09">FE99E5267950B241F96C96DC492ACAC542F67A55</LoginResult> </soap:Body> </soap:Envelope>
내가 노력하고있어 :
How to parse SOAP response without SoapClient
simplexml_load_string
으로 구문 분석 :
parse an XML with SimpleXML which has multiple namespaces 및 여기 :
Trouble Parsing SOAP response in PHP using simplexml,하지만 작동시키지 못합니다.
$xml = simplexml_load_string($this->getFullResponse());
$xml->registerXPathNamespace('soap', 'http://schemas.xmlsoap.org/soap/envelope/');
$xml->registerXPathNamespace('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
$xml->registerXPathNamespace('xsd', 'http://www.w3.org/2001/XMLSchema');
foreach($xml->xpath('//soap:Body') as $header) {
var_export($header->xpath('//LoginResult'));
}
하지만 아직 결과 만이 얻을 : 내가 잘못을
/* array ()
를하고있는 중이 야 무엇
이 내 코드? 아니면 이해하기 쉽지 않은 간단한 일은 무엇입니까?
MySqlError하여 DOM과의 작업 최종 결과 :
$doc = new DOMDocument();
$doc->loadXML($response );
echo $doc->getElementsByTagName("LoginResult")->item(0)->nodeValue;
ndm에 의해 SimpleXML을 가진 작업 최종 결과 :
$xml = simplexml_load_string($response);
foreach($xml->xpath('//soap:Body') as $header) {
echo (string)$header->LoginResult;
}
PHP DOMDocument를 http://php.net/manual/en/class.domdocument.php – MySqlError
DOMDocument를 사용하는 대체 솔루션을 원하십니까? – MySqlError
물론 시도해 볼 수 있습니다. – Peon