servicioSoap.php 1.1 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. if ($_GET['class'] && (in_array($_GET['class'], $WSClasses) || in_array($_GET['class'], $WSStructures))) {
  3. $WSHelper = new WSHelper("http://schema.flowdat.com", $_GET['class']);
  4. $WSHelper->actor = "http://schema.flowdat.com";
  5. $WSHelper->use = SOAP_ENCODED;
  6. $WSHelper->classNameArr = $WSClasses;
  7. $WSHelper->structureMap = $WSStructures;
  8. $WSHelper->setPersistence(SOAP_PERSISTENCE_REQUEST);
  9. $dirname = "/tmp/cache/wsdl";
  10. if (!realpath($dirname)) {
  11. $dirname = sys_get_temp_dir();
  12. }
  13. $cache_dir = realpath($dirname);
  14. if (!is_dir($cache_dir)) {
  15. mkdir($dirname, 0777, true);
  16. }
  17. $WSHelper->setWSDLCacheFolder($dirname . '/');
  18. try {
  19. $WSHelper->handle();
  20. //possible db transaction commit
  21. } catch (\Exception $e) {
  22. //possible db transaction rollback
  23. $WSHelper->fault("SERVER", $e->getMessage() . "\n" . $e->getTraceAsString(), "", $e->__toString() . "\n" . $e->getTraceAsString());
  24. }
  25. } else {
  26. header('Location:'.$_SERVER['REQUEST_URI'] . '?class=' . $WSClasses[0]);
  27. die("No valid class selected");
  28. }