Getting internal server error while cancelling a user through xmpphp

nyI am creating a script for instant messaging using php.

To communicate PHP with Openfire ,I have used xmpphp library as client.

This is working fine .

Now I want option to create user registered and canceled using php.

For this I have read the xmpp specification.

I am able to create a new user .

But when I try to cancel a user ,I am getting internal server error.

As per the specification I should get errors other than internal server error if any wrong is happened.

I following specification at http://xmpp.org/extensions/xep-0077.html .

My code is below .

public function cancelUser($username){

//echo “Parth is here”;

//exit;

$id = ‘unreg_’ . $this->getID();

            $xml = "<iq type='set' from='rahul@mysystem.com' id='$id'>

";

$this->addIdHandler($id, ‘cancel_user_handler’);

$this->send($xml);

}

Any help or thought is really required.

Thanks and Regards

Parth