for some cases , ignoring location from initialization throw exception
PHP Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host
Better call and define the end point location manually.(PHP 5 >= 5.0.4, PHP 7, PHP 8)
SoapClient::__setLocation — Bestimmt die Adresse des zu nutzenden Webservices
Bestimmt die URL, die von den folgenden SOAP-Aufrufen angesprochen werden
soll. Dies entspricht der Angabe der location-Option
bei der Erstellung des SoapClients.
Hinweis:
Der Aufruf dieser Methode ist optional. Der SoapClient verwendet standardmäßig die Adresse aus dem WSDL.
locationDie neue Ziel-URL.
Die alte Ziel-URL.
| Version | Beschreibung |
|---|---|
| 8.0.3 |
location ist jetzt nullbar.
|
Beispiel #1 SoapClient::__setLocation()-Beispiel
<?php
$client = new SoapClient('http://example.com/webservice.php?wsdl');
$client->__setLocation('http://www.somethirdparty.com');
$old_location = $client->__setLocation(); // löscht die location-Option
echo $old_location;
?>Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
http://www.somethirdparty.com
for some cases , ignoring location from initialization throw exception
PHP Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host
Better call and define the end point location manually.