$client = new SoapClient("http://example.com/webservice.wsdl"); $client->__setLocation("http://newendpoint.com/webservice"); $response = $client->someMethod($params);
$options = array( 'location' => 'http://example.com/webservice', 'uri' => 'http://example.com/webservice', ); $client = new SoapClient(null, $options); $response = $client->__soapCall('someMethod', $params);In this example, we create a new SoapClient object with no WSDL and set the endpoint URL and namespace URI in the options array. Then we call the __soapCall method to make a SOAP request using a method on the endpoint. The PHP SoapClient class is part of the PHP SOAP extension, which is a part of the PHP core distribution.