What are the key differences between using nuSOAP and SOAP in PHP for web service integration?

When integrating web services in PHP, one key difference between using nuSOAP and SOAP is that nuSOAP is a lightweight library that simplifies the process of creating and consuming SOAP web services, while SOAP is a built-in extension in PHP that provides native support for SOAP. Additionally, nuSOAP allows for easier handling of complex data types and WSDL files, while SOAP extension in PHP offers better performance due to its native implementation.

// Using nuSOAP for web service integration
require_once('lib/nusoap.php');
$client = new nusoap_client('http://example.com/service.wsdl', true);
$response = $client->call('WebServiceFunction', array('param1' => 'value1', 'param2' => 'value2'));
echo $response;

// Using SOAP extension in PHP for web service integration
$client = new SoapClient('http://example.com/service.wsdl');
$response = $client->WebServiceFunction(array('param1' => 'value1', 'param2' => 'value2'));
echo $response;