Request for soap xml

0

Hello, you can do this code differently in php and delphi if yes thanks help I do not know if I should make the requests so thank you some soap tips is not my strong

    $request = '
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/" xmlns:a="http://www.w3.org/2005/08/addressing">
   <soap:Header>
   <a:Action soap:mustUnderstand="1">http://tempuri.org/IWSClientes/envioExcelCarteiraClientes</a:Action>
   <SecurityToken xmlns="ns">   ehTpkDFKUhKIkShjIH9Zcv0xAHRoZ4sfc7HgNrqrfDiFBt/FFD3EEX9IqXZiPd7Zwcrr4VUUAZTbw
   ls4MIHEMTnuBLaFyee0bOPSnnvavvutKG2NSTdy9XqHnkxk/mFJXDC2+LsJ+3DuOvpFbfuvHEr
 ZbsP36gjarXpAnaHwbNWJvFHPcNMLStmE9eRwxbFQ==L9+zby7w1V5OZTVGUPLZ1x8rJYzCEHAnxovPUuyadZFdbv21el
   Z1qsvyp3kzbVR2s155E/Fea+8tXySxU7XfCMlut2mQ/YxvqzeQNIAc5JF99688MPfwqt
</SecurityToken>
   <a:To soap:mustUnderstand="1">https://servicebusq.lusitania.pt/Clientes/Servicos/WSClientes.svc/WSClientes.svc</a:To>
   </soap:Header>
   <soap:Body>
      <tem:envioExcelCarteiraClientes>
         <!--Optional:-->
         <tem:CompanhiaConexao>1026</tem:CompanhiaConexao>
      </tem:envioExcelCarteiraClientes>
   </soap:Body>
</soap:Envelope>';
$headers = array(
    'Content-Type: application/soap+xml;charset=UTF-8;',

);

// Cria o objeto cURL e define as propriedades por defeito
$soap_do = curl_init();
curl_setopt($soap_do, CURLOPT_URL, 'https://servicebusq.lusitania.pt/Clientes/Servicos/WSClientes.svc/WSClientes.svc');
curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($soap_do, CURLOPT_TIMEOUT, 10);
curl_setopt($soap_do, CURLOPT_HTTPHEADER, $headers);
curl_setopt($soap_do, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
curl_setopt($soap_do, CURLOPT_USERPWD, "user:!teste#"); //Your credentials goes here
curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($soap_do, CURLOPT_POST, true);
curl_setopt($soap_do, CURLOPT_POSTFIELDS, $request);
$curlResponse = curl_exec($soap_do);


 print_r($curlResponse);

$data = curl_exec($soap_do); 
if(!$data){
    print_r('ERROR: ' . curl_error($ch));
}

curl_close($soap_do);
    
asked by anonymous 04.05.2017 / 15:42

0 answers