0
검색 디렉토리에 HIV 전문가를 찾는 요청을하고 있습니다. 그들이 제공하는 문서는 다음과 같습니다. http://mobile.aahivm.org/getinfo.asmx?op=GetProvidersSOAP 요청이 응답을 반환하지 않습니다.
저는 PHP의 cUrl을 사용하여 요청합니다. 왜 아무 것도 반환되지 않는 아이디어?
<?php
$curlData = '<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetProviders xmlns="http://localhost">
<fname></fname>
<lname></lname>
<locationzip></locationzip>
<locationcity></locationcity>
<locationstate>New York</locationstate>
<locationcountry></locationcountry>
<primaryservicesid></primaryservicesid>
<credentials></credentials>
<specialty></specialty>
<specialtycare></specialtycare>
<support></support>
<paymentoptions></paymentoptions>
<member></member>
</GetProviders>
</soap12:Body>
</soap12:Envelope>';
$url='http://mobile.aahivm.org/getinfo.asmx?op=GetProviders';
$curl = curl_init();
$length = strlen($curlData);
curl_setopt ($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_VERBOSE, true);
curl_setopt($curl,CURLOPT_HTTPHEADER,array (
'POST /getinfo.asmx HTTP/1.1',
'Host: mobile.aahivm.org',
'Content-Type: application/soap+xml; charset=utf-8',
'Content-Length:'=>$length,
'SOAPAction: "http://localhost/GetProviders"'
));
curl_setopt ($curl, CURLOPT_POST, 1);
curl_setopt ($curl, CURLOPT_POSTFIELDS, $curlData);
//$result = substr(curl_exec($curl), 285, -72); ///remove SOAP envelope!
$result = curl_exec($curl);
print_r("Curl result: ".$result."<br><br><hr>");
curl_close ($curl);
$arr2 = array();
$arr2[] = json_decode($result, true);
////
foreach ($arr2 as $key=>$value) {
//echo $value;
$next[] = $value;
foreach ($next as $key=>$value) {
//echo $value;
$next[] = $value;
foreach ($next as $key=>$value) {
echo $key."=".$value."<br />";
}
echo "--<br /><br />";
}
}
/////
?>
그냥 명확하게하기 위해 약간, $ 결과가 null하는 데 도움이, 또는 빈 배열로 다시 오는가? – WillardSolutions