質問編集履歴
1
プログラム追加
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -14,4 +14,49 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
少ない情報で申し訳御座いませんが、
|
|
17
|
-
ヒントをお持ちの方よろしくお願いします。
|
|
17
|
+
ヒントをお持ちの方よろしくお願いします。
|
|
18
|
+
|
|
19
|
+
-----------------------------------------------
|
|
20
|
+
とあるAPIです。
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<?php
|
|
24
|
+
$url = 'http://openapi.ctrip.com/Hotel/OTA_HotelRatePlan.asmx';
|
|
25
|
+
|
|
26
|
+
$xml = '<?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><Request xmlns="http://ctrip.com/"><requestXML><Request>
|
|
27
|
+
<Header AllianceID="13790" SID="447679" TimeStamp="1423685768" Signature="A86E83DA8BD13EA78A8ECF33FF0A42FA" RequestType="OTA_HotelRatePlan" AsyncRequest="false" Timeout="0" MessagePriority="3" />
|
|
28
|
+
<HotelRequest>
|
|
29
|
+
<RequestBody xmlns:ns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
|
30
|
+
<ns:OTA_HotelRatePlanRQ TimeStamp="2012-05-01T00:00:00.000+08:00" Version="1.0">
|
|
31
|
+
<ns:RatePlans>
|
|
32
|
+
<ns:RatePlan>
|
|
33
|
+
<ns:DateRange Start="2016-04-13" End="2016-04-20"/>
|
|
34
|
+
<ns:RatePlanCandidates>
|
|
35
|
+
<ns:RatePlanCandidate AvailRatesOnlyInd="true" >
|
|
36
|
+
<ns:HotelRefs>
|
|
37
|
+
<ns:HotelRef HotelCode="345001"/>
|
|
38
|
+
</ns:HotelRefs>
|
|
39
|
+
</ns:RatePlanCandidate>
|
|
40
|
+
</ns:RatePlanCandidates>
|
|
41
|
+
</ns:RatePlan>
|
|
42
|
+
</ns:RatePlans>
|
|
43
|
+
</ns:OTA_HotelRatePlanRQ>
|
|
44
|
+
</RequestBody>
|
|
45
|
+
</HotelRequest>
|
|
46
|
+
</Request></requestXML></Request></soap:Body></soap:Envelope>';
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
$cnt = stream_context_create(
|
|
50
|
+
array(
|
|
51
|
+
'http' => array(
|
|
52
|
+
'method' => "POST",
|
|
53
|
+
'header' => "Content-Type: text/xml; charset=utf-8;",
|
|
54
|
+
'content' => $xml )
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
$res = file_get_contents($url, false, $cnt);
|
|
59
|
+
|
|
60
|
+
var_dump($res);
|
|
61
|
+
|
|
62
|
+
?>
|