很抱歉必须这样做,但是我没有得到运行这个特定网络服务的人的爱.我以前从未使用过SOAP.
这是我认为应该工作的代码
public function soapTest(){
echo "start <br />";
use_soap_error_handler(true);
$client = new SoapClient("https://cwi.rezexchange.com:9991/?wsdl");
// here's the problem. What goes in the parenthesis?
$result = $client->CwiRateDetails(????);
echo($result);
echo "<br /> end";
}
Run Code Online (Sandbox Code Playgroud)
现在我猜这会告诉我括号应该包含什么.
POST /Service.asmx HTTP/1.1
Host: cwi.rezexchange.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://hotelconcepts.com/CwiRateDetails"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CwiRateDetails xmlns="http://hotelconcepts.com/">
<PropertyCode>string</PropertyCode>
<DateFrom>dateTime</DateFrom>
<DateTo>dateTime</DateTo>
<RatePlan>string</RatePlan>
<RoomType>string</RoomType>
<PromotionalRates>boolean</PromotionalRates>
</CwiRateDetails>
</soap:Body>
</soap:Envelope>
Run Code Online (Sandbox Code Playgroud)
我猜是有点像
$result = $client->CwiRateDetails($PCode, $DateFrom, $DateTo, $RatePlan, $RoomType, false);
Run Code Online (Sandbox Code Playgroud)
应该管用.但我不知道日期格式是什么,或者房间类型是什么或如何引用费率计划.
现在.在我通过电子邮件与他们一起去猿人之前,我错误地认为他们需要提供更多信息吗?或者是否有某种SOAP技巧可以用来从某个地方获取信息?
尝试
$result = $client->CwiRateDetails(array(
'PropertyCode' => ...,
'DateFrom' => ...,
'DateTo' => ...,
'RatePlan' => ...,
'RoomType' => ...,
'PromotionalRates' => ...,
));
Run Code Online (Sandbox Code Playgroud)
你必须将序列号的日期,时间值DateFrom和DateTo和布尔值PromotionalRates根据XML Schema规范:
true= 'true'或1和false= 'false'或0YYYY-MM-DDT hh:mm:ssZ或本地时间的YYYY-MM-DDT hh:mm:ss(+/-)hh:mm,包括时区信息; 时区信息是可选的