curl 发送soap请求 webservice

* soap.php

 

  
   
   
    ?????
    ??????
   
   2
   10
   2577948
   
  
 
EOF;

array_push($headers, sprintf("Content-Length: %d", strlen($postdata)));

curl_setopt_array($ch, [
    CURLOPT_URL => 'http://jdkj100.webpower.asia/x/soap-v5.1/server.php/SendSingleMailing',
    CURLOPT_HEADER => 1,
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_POST => 1,
    CURLOPT_BINARYTRANSFER => 1,
    CURLOPT_SAFE_UPLOAD => 1,
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_POSTFIELDS => $postdata
]);

$data = curl_exec($ch);
curl_close($ch);

echo $data.PHP_EOL;

* run:

$ php soap.php
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 16 Mar 2019 10:18:46 GMT
Content-Type: text/xml; charset=utf-8
Content-Length: 335
Connection: keep-alive
Vary: Accept-Encoding


true
 

你可能感兴趣的:(php)