Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <?php
  2. namespace AppHttpControllers;
  3. use ArtisaninwebSoapWrapperFacadesSoapWrapper;
  4. class SoapController extends Controller {
  5. public function demo()
  6. {
  7. // Add a new service to the wrapper
  8. SoapWrapper::add(function ($service) {
  9. $service
  10. ->name('currency')
  11. ->wsdl('path/to/wsdl')
  12. ->trace(true);
  13. ->options(['user' => 'username', 'pass' => 'password']);
  14. });
  15.  
  16. // Using the added service
  17. SoapWrapper::service('currency', function ($service) {
  18. var_dump($service->getFunctions());
  19. var_dump($service->call('Otherfunction'));
  20. });
  21. }
  22. }
  23.  
  24. <?php
  25. namespace AppHttpControllers;
  26. use ArtisaninwebSoapWrapperFacadesSoapWrapper;
  27. class SoapController extends Controller {
  28. public function demo()
  29. {
  30. // Add a new service to the wrapper
  31. SoapWrapper::add(function ($service) {
  32. $service
  33. ->name('currency')
  34. ->wsdl('path/to/wsdl')
  35. ->trace(true);
  36. });
  37. $data = [
  38. 'user' => 'username',
  39. 'pass' => 'password',
  40. ];
  41. // Using the added service
  42. SoapWrapper::service('currency', function ($service) use ($data) {
  43.  
  44. var_dump($service->call('Login', [$data]));
  45. var_dump($service->call('Otherfunction'));
  46. });
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement