Advertisement
Guest User

Untitled

a guest
Jan 29th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. Warning: Uncaught SoapFault exception: [HTTP] Error Fetching http headers in soapclient.php Stack trace: #0
  2. [internal function]: SoapClient->__doRequest('__call('addUser', Array) #2 {main} thrown in soapclient.php
  3.  
  4.  
  5. Fatal error: Maximum execution time of 30 seconds exceeded in soapclient.php on line 30
  6.  
  7. <?php
  8.  
  9. $first_name = $_POST['first_name'];
  10. $last_name = $_POST['last_name'];
  11. $username = $_POST['username'];
  12. $password = md5($_POST['password']);
  13.  
  14. $options = array('location' => "http://localhost/fellotest/soap/soap_client.php",
  15. 'uri' => 'http://localhost',
  16. 'trace'=>1);
  17.  
  18. ini_set('default_socket_timeout', 120)
  19.  
  20. try{
  21. $client = new SoapClient(null, $options);
  22. $client->addUser($first_name, $last_name, $username, $password);
  23. }
  24. catch(SoapFault $ex){
  25. echo "FAULT </br>";
  26. var_dump($client->__getLastRequest());
  27. var_dump($client->__getLastResponse());
  28. var_dump($ex);
  29. }
  30.  
  31. ?>
  32.  
  33. <?php
  34.  
  35. include('helperssecurity.php');
  36. include('includessharedez_sql_core.php');
  37. include('includesmysqliez_sql_mysqli.php');
  38.  
  39. // Setting up Soap Service
  40. $options = array('uri' => 'http://localhost');
  41. $server = new SoapServer(null, $options)
  42.  
  43. //connecting and adding a user to database
  44. function addUser($first_name, $last_name, $username, $password){
  45.  
  46. // For security reasons
  47. $info = new security();
  48.  
  49. // Connect to database
  50. $db = new ezSQL_mysqli($info::$user, $info::$password, $info::$dbName, $info::$host);
  51. if(!$db){
  52. die('Could not connect to database');
  53. }
  54. // add user to database
  55. $insert = $db->query("INSERT INTO `user`(`first_name`, `last_name`, `username`, `password`) VALUES ('$first_name', '$last_name', '$username', '$password')");
  56. if(!$insert){
  57. echo "Error while registering";
  58. }
  59. else{
  60. echo "Register Successful";
  61. }
  62. }
  63.  
  64. // To handle client
  65. $server->handle();
  66.  
  67. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement