SoapClient::__setLocation

Sets the location of the Web service to use

&reftitle.description; public ``string``null```SoapClient::__setLocation` ``string``null```location`&null;

Sets the endpoint URL that will be touched by following SOAP requests. This is equivalent to specifying the `location` option when constructing the SoapClient.

Calling this method is optional. The SoapClient uses the endpoint from the WSDL file by default.

&reftitle.parameters;

`location`

- The new endpoint URL.

&reftitle.returnvalues;

The old endpoint URL.

&reftitle.changelog;

&Version; | &Description;
8.0.3 | `location` is nullable now.

&reftitle.examples;

### `SoapClient::__setLocation` example

    <?php
    $client = new SoapClient('http://example.com/webservice.php?wsdl');

    $client->__setLocation('http://www.somethirdparty.com');

    $old_location = $client->__setLocation(); // unsets the location option

    echo $old_location;

    ?>

&example.outputs.similar;

    http://www.somethirdparty.com

&reftitle.seealso;

- `SoapClient::__construct`