verticalstorageimporter.php 943 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Giancarlo
  5. * Date: 20/07/2018
  6. * Time: 16:07
  7. */
  8. class SoapClientNG extends \SoapClient{
  9. public function __doRequest($req, $location, $action, $version = SOAP_1_1, $one_way = NULL) {
  10. $xml = explode("\r\n", parent::__doRequest($req, $location, $action, $version, $one_way));
  11. $response = preg_replace( '/^(\x00\x00\xFE\xFF|\xFF\xFE\x00\x00|\xFE\xFF|\xFF\xFE|\xEF\xBB\xBF)/', "", $xml[0] );
  12. return $response;
  13. }
  14. }
  15. $soapClient = new SoapClient("http://192.168.253.128/servizi_xchange.asmx?wsdl", array(
  16. 'trace' => true,
  17. 'exceptions' => true,
  18. 'cache_wsdl' => false,
  19. ));
  20. try {
  21. $r = $soapClient->__doRequest(file_get_contents('test.xml'), 'http://192.168.253.128/servizi_xchange.asmx', 'servizi_xchange/ImportLists', SOAP_1_1);
  22. } catch (SoapFault $e) {
  23. echo "Exception\n";
  24. print_r($e);
  25. echo "Response\n";
  26. print_r($soapClient->__getLastResponse());
  27. }
  28. print_r($r);