<?php
ini_set('soap.wsdl_cache_enabled',0);
ini_set('soap.wsdl_cache_ttl',0);
$soap_server = new SoapServer('Notification.wsdl');
$soap_server->addFunction('Notify');
function Notify($message)
{
return array('message' => $message);
}
$soap_server->handle();
?>
이 그리고이 오류를 던지고 것입니다 내 클라이언트 코드입니다 서버 코드는 호스트에 연결할 수 없습니다지고 보관하십시오. 엔드 포인트는 https입니다. wsdl 파일은 로컬입니다.
<?php
$context = stream_context_create(array(
'https' => array(
'cafile' => 'APX_WS_API1.cer',
'verify_peer' => true
)
));
$soap_client = new SoapClient('http://localhost:8888/Receiver/Notification.wsdl',
array('stream_context' => $context,'local_cer' => 'APX_WS_API1.cer'));
try{
$result = $soap_client->__soapCall('Notify',array('message' => 'Hello World'));
echo $result;
}catch(SoapFault $e){
echo "Error: " . $e->faultstring;
}
?>
누군가 내가 뭘 잘못하고 있는지 말해 줄 수 있습니까? 미리 감사드립니다.
새로운 SoapClient ('http : // loc..' =>'새로운 SoapClient ('https : // loc..') 컨텍스트에 https 옵션을 지정해도 전송이 이루어지지 않을 때는 아무런 의미가 없습니다 .. – Wrikken
빠른 응답을 위해 지금 나는 치명적인 오류가 발생합니다 : Uncaught SoapFault 예외 : [WSDL] SOAP-ERROR : WSDL 파싱 : 'https : // localhost : 8888/Receiver/Notification.wsdl'에서로드 할 수 없습니다. : 실패했습니다. 스택 트레이스 : # 0 C : \ wamp \ www \ Receiver \ soap_client.php : C : \ wamp \ www \ Receiver \ soap_client.php의 외부 엔티티 "https : // localhost : 8888/Receiver/Notification.wsdl" (13) : SoapClient -> SoapClient ('https : // localho ...', Array) # 1 {main}이 C : \ Wamp \ www \ Receiver \ soap_client.php에 13 행에 넣습니다. –