Я надеюсь, что смогу помочь, если это возможно, у меня может быть бэкэнд в Laravel, и мне нужно использовать некоторые SOAP веб-сервисы, для этого я использую нативный класс SoapClient()
. Я получаю эту ошибку:
SOAP ОШИБКА: Схема анализа: вы не можете импортировать схему из http: // [отредактировано]? Xsd = xsd0
Я не могу отобразить URL, потому что это частный, но внешний сервер компании. Вот мой код:
public function getCotizacion(){
// phpinfo();
$Empresa = $this->set_Empresa();
$Sistema = $this->set_Sistema();
$Direcciones = $this->set_Direcciones();
$namespace = "http://[redacted]";
$IdConfiguracion = $this->set_IdConfiguracion();
$Solicitante = $this->set_Solicitante();
$FechaRegistro = date("c");
$WCFBroker = $this->set_WCFBroker();
$options = array(
"trace" => 1,
"encoding" => "UTF-8",
"verifypeer" => false,
"verifyhost" => false,
"proxy_port" => 7801,
"soap_version" => SOAP_1_2,
"trace" => 1,
"exceptions" => true,
"cache_wsdl"=>WSDL_CACHE_NONE
);
// SOAP client
$soapClient = new \SoapClient($WCFBroker, $options);
$auth = array(
'Empresa' => (string) $Empresa,
'Sistema' => (string) $Sistema,
'Direcciones' => (string) $Direcciones
);
$header = new \SoapHeader($namespace, 'SeguridadHeaderElement', $auth, false);
$soapClient->__setSoapHeaders($header);
// nodos de arreglo body
$request0 = new stdClass();
$request0->FechaHora = $FechaRegistro;
$request1 = new stdClass();
$request1->ConsecutivoConfiguracion = $IdConfiguracion;
$request1->Solicitante = $Solicitante;
$request1->Parametros = new \SoapVar($Trama, XSD_ANYXML);
$parameters = new stdClass();
$parameters->InfoSolicitud = array('InfoTransaccion' => $request0, 'Cotizacion' => $request1);
$Info = array();
try {
$Info['Info'] = $soapClient->CotizarPoliza($parameters);
} catch (SoapFault $fault) {
$Info['Info'] = $fault;
}
$Info['request']['headers'] = $soapClient->__getLastRequestHeaders();
$Info['request']['body'] = $soapClient->__getLastRequest();
$Info['response']['headers'] = $soapClient->__getLastResponseHeaders();
$Info['response']['body'] = $soapClient->__getLastResponse();
return $Info;
}
Ошибка отображает эту строку как ошибку:
$soapClient = new \SoapClient($WCFBroker, $options);
Что не так?