0
XML 객체가 포함 된 POST 요청을 서버에 보내려면 PHP 코드가 있어야하지만 작동하지 않습니다. 문제가 요청과 함께 있다고 생각합니다. 나는 그들이 제안한 것을하려했지만 여전히 효과가 없다. 여기에 내 PHP 코드 :PHP에서 XML 객체 요청 보내기
$url = 'http://example/service.asmx';
$xml='<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Get_schadual xmlns="http://tempuri.org/">
<User>exmaple</User>
</Get_schadual>
</soap:Body>
</soap:Envelope>';
$post_data = array('xml' => $xml);
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n X-Requested-With: XmlHttpRequest",
'method' => 'POST',
'content' => http_build_query($post_data)));
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
var_dump($result);
"작동하지 않음"이라는 의미를 지정하십시오. 어떤 오류가 발생합니까? 어떤 응답을 받습니까? –