PHP Function

I’m trying to create a web service which retruns a value,I’m using this code and need some help with the php code.

1-I uploaded ‘lib/nusoap’ from [URL=“”]

2-Then i created Request.php contains

$c = new soapclient(''); //creation of object for soap
$name = $c->call('getfirstname',array('id' => '1'));
echo "The firstname for id '1' is --- ". $name;

3-Then i created Response.php contains:

function getfirstname($id) {

return "ragy";


$server = new soap_server();
$server->configureWSDL('details', 'urn:firstname');
array('userid' => 'xsd:firstname'),
array('name' => 'xsd:lastname'),


4- When executing the “
the error appear :

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I am not sure with nusoap library. But I had given you an example here yesterday.

You can follow and understand how it works. You will be able to create your own web service and test it yourself.