php - php中的soapUI WSDL webservices得到500响应
问题描述
<?php
$soapUrl = "https://example.com/server.php?wsdl";
$xml_post_string = '<?xml version="1.0" encoding="utf-8"?>
soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mob="http://wigi.iseek.com.au/b2b/wigi/mobilevoice">
<soapenv:Header/>
<soapenv:Body>
<mob:GetPlans>
<getPlansRequest>
<accountID>555</accountID>
</getPlansRequest>
</mob:GetPlans>
<soap:Fault>
</soap:Fault>
</soapenv:Body>
</soapenv:Envelope>';
$headers = array(
"Content-type: text/xml;charset=\"utf-8\"",
"Accept: text/xml",
"Cache-Control: no-cache",
"Pragma: no-cache",
"SOAPAction: http://wigi.iseek.com.au/b2b/wigi/mobilevoice/GetPlans",
"Content-length: ".strlen($xml_post_string),
); //SOAPAction: your op URL
$url = $soapUrl;
$clientcert = "/home/example/ssl/csrs/client.pem";
$keyfile = "/home/example/ssl/keys/key.pem";
$challenge = "QAZXSW";
// PHP cURL for https connection with auth
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the
SOAP 请求
curl_setopt($ch, CURLOPT_SSLCERT, $clientcert);
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $challenge);
curl_setopt($ch, CURLOPT_SSLKEYTYPE, 'PEM');
curl_setopt($ch, CURLOPT_SSLKEY, $keyfile);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// converting
$response = curl_exec($ch);
$n=curl_getinfo($ch);
print_r($n);
curl_close($ch);
// converting
$response1 = str_replace("<soap:Body>","",$response);
$response2 = str_replace("</soap:Body>","",$response1);
// convertingc to XML
$parser = simplexml_load_string($response2);
// user $parser to get your data out of XML response and to display it.
?>
我的输出:
数组 ( [url] => https://example.com.au/testservice/server.php?wsdl [content_type] => text/xml; charset=utf-8 [http_code] => 500 [header_size] => 277 [request_size] => 743 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.056019 [namelookup_time] => 0.004583 [connect_time] => 0.004818 [pretransfer_time] => 0.034581 [ size_upload] => 484 [size_download] => 278 [speed_download] => 4964 [speed_upload] => 8642 [download_content_length] => 278 [upload_content_length] => 484 [starttransfer_time] => 0.055833 [redirect_time] => 0 [redirect_url] => [primary_ip] => 104.252.153.31 [certinfo] => 数组 () [primary_port] => 443 [local_ip] => 104.252.153.31 [local_port] => 34821)
我是卷曲的 saopui 新手,请帮助我
解决方案
推荐阅读
- c# - Xamarin 的 Browser.CloseAsync()
- c# - 如何防止 ${aspnet-request-posted-body} 不记录敏感信息
- node.js - pg-promise:为查询流中的每一行运行依赖查询耗尽内存
- pandas - 如何在熊猫列表中减去元组元素并应用条件?
- typescript - 打字稿 - 克隆一个对象并转换为另一种类型
- node.js - MongoDB 通过 Mongoose JS - findByID res out of funktion
- amazon-web-services - 建议:设置允许用户从设备创建 rtmp 推送端点的流服务
- python - 为什么 sympy 不能计算非常简单的积分
- amazon-web-services - 使用 AWS-CDK (python) 将多个现有安全组添加到 EC2
- python - Discord.py Massdm