質問編集履歴
1
プログラム追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -31,3 +31,93 @@
|
|
31
31
|
少ない情報で申し訳御座いませんが、
|
32
32
|
|
33
33
|
ヒントをお持ちの方よろしくお願いします。
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
-----------------------------------------------
|
38
|
+
|
39
|
+
とあるAPIです。
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
<?php
|
46
|
+
|
47
|
+
$url = 'http://openapi.ctrip.com/Hotel/OTA_HotelRatePlan.asmx';
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
$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>
|
52
|
+
|
53
|
+
<Header AllianceID="13790" SID="447679" TimeStamp="1423685768" Signature="A86E83DA8BD13EA78A8ECF33FF0A42FA" RequestType="OTA_HotelRatePlan" AsyncRequest="false" Timeout="0" MessagePriority="3" />
|
54
|
+
|
55
|
+
<HotelRequest>
|
56
|
+
|
57
|
+
<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">
|
58
|
+
|
59
|
+
<ns:OTA_HotelRatePlanRQ TimeStamp="2012-05-01T00:00:00.000+08:00" Version="1.0">
|
60
|
+
|
61
|
+
<ns:RatePlans>
|
62
|
+
|
63
|
+
<ns:RatePlan>
|
64
|
+
|
65
|
+
<ns:DateRange Start="2016-04-13" End="2016-04-20"/>
|
66
|
+
|
67
|
+
<ns:RatePlanCandidates>
|
68
|
+
|
69
|
+
<ns:RatePlanCandidate AvailRatesOnlyInd="true" >
|
70
|
+
|
71
|
+
<ns:HotelRefs>
|
72
|
+
|
73
|
+
<ns:HotelRef HotelCode="345001"/>
|
74
|
+
|
75
|
+
</ns:HotelRefs>
|
76
|
+
|
77
|
+
</ns:RatePlanCandidate>
|
78
|
+
|
79
|
+
</ns:RatePlanCandidates>
|
80
|
+
|
81
|
+
</ns:RatePlan>
|
82
|
+
|
83
|
+
</ns:RatePlans>
|
84
|
+
|
85
|
+
</ns:OTA_HotelRatePlanRQ>
|
86
|
+
|
87
|
+
</RequestBody>
|
88
|
+
|
89
|
+
</HotelRequest>
|
90
|
+
|
91
|
+
</Request></requestXML></Request></soap:Body></soap:Envelope>';
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
$cnt = stream_context_create(
|
98
|
+
|
99
|
+
array(
|
100
|
+
|
101
|
+
'http' => array(
|
102
|
+
|
103
|
+
'method' => "POST",
|
104
|
+
|
105
|
+
'header' => "Content-Type: text/xml; charset=utf-8;",
|
106
|
+
|
107
|
+
'content' => $xml )
|
108
|
+
|
109
|
+
)
|
110
|
+
|
111
|
+
);
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
$res = file_get_contents($url, false, $cnt);
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
var_dump($res);
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
?>
|