Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. require_once "php/class/nusoap-0.9.5/lib/nusoap.php";
  2.  
  3. $soap = new soap_server;
  4.  
  5. $soap->configureWSDL('WS-WebCodeFree', 'http://www.philipsvaloriza.com.br/teste-server.php');
  6.  
  7. $soap->wsdl->schemaTargetNamespace = 'http://www.philipsvaloriza.com.br/teste-server.php';
  8.  
  9. $soap->register(
  10. 'info',
  11. array(),
  12. array('x' => 'xsd:string'),
  13. 'http://soapinterop.org/'
  14. );
  15.  
  16. $soap->register(
  17. 'post_java',
  18. array(),
  19. array('x' => 'xsd:string'),
  20. 'http://soapinterop.org/'
  21. );
  22.  
  23. $soap->register(
  24. 'post_php',
  25. array(),
  26. array('x' => 'xsd:string'),
  27. 'http://soapinterop.org/'
  28. );
  29.  
  30. $soap->register(
  31. 'login_user',
  32. array('login' => 'xsd:string','pass' => 'xsd:int'),
  33. array('x' => 'xsd:string'),
  34. 'http://soapinterop.org/'
  35. );
  36.  
  37. $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : 'teste123';
  38. $soap->service(isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '');
  39.  
  40. function info(){
  41. return "WebCodeFree - Desenvolvimento Web.";
  42. }
  43.  
  44. function post_java(){
  45. return "Em Breve Acesso a Postagens Java Via Serviço";
  46. }
  47.  
  48. function post_php(){
  49. return "Em Breve Acesso a Postagens PHP Via Serviço";
  50. }
  51.  
  52. function login_user($login, $senha){
  53. return "Seja Bem Vindo Usuário ". $login . " !!!";
  54. }
  55.  
  56. include('lib/nusoap.php');
  57.  
  58.  
  59. $cliente = new nusoap_client('http://localhost/vinicius/thiengo/doc/projects/web-service-php-nusoap/servidor.php?wsdl');
  60.  
  61.  
  62. $result1 = $client->call('info');
  63.  
  64. $result2 = $client->call('post_java');
  65.  
  66. $result3 = $client->call('post_php');
  67.  
  68. $result4 = $client->call('login_user', array('Paulo',12));
  69.  
  70. echo $result1."<br>";
  71. echo $result2."<br>";
  72. echo $result3."<br>";
  73. echo $result4."<br>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement