I am brandy new to SOAP and XML. I am proficient with CFML. I need to request information from a hotel reservation webservice and store the response in a MS Access database to be used by my CFML application. I will be translating to mySQL later in the development of the application.
Below is the XML code that I received from the webservice provider:
Technical information
The Hotel interface runs onto HTTP protocol and both Xml request and responses should be into a SOAP message. This way allows multiple Xml functions in the same message and save in communications. But the main advantage is that SOAP offers many integration possibilities with many systems using free and available libraries by Internet. In any case the SOAP tags are optional and can be omitted.
See Soap-tags below:
Soap Request Sample
<?xml version="1.0.1" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<barceloDS_requests>
.
.
.
</barceloDS_requests>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Soap Response Sample
<?xml version="1.0.1" encoding="ISO-8859-1" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<barceloDS_responses>
.
.
.
</barceloDS_responses>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Webservice url address:
http:// 194.224.184.162/barceloDS/
interface/
xml
'The XML Request Sample'
<?xml version="1.0" encoding="UTF-8"?>
<barceloDS_requests>
<request type="availability list" id="1">
<session_id>aaa6SP8c6P5BAJ
</session_
id>
<language_code>ING</langua
ge_code>
<agency>
<primary>888</primary>
<secondary>88</secondary>
<detail>888</detail>
<branch>1</branch>
</agency>
<contract/>
<check_in_date>20030701</c
heck_in_da
te>
<check_out_date>20030707</
check_out_
date>
<location>
<destination_code>PMI</des
tination_c
ode>
<zone_code/>
</location>
<establishment>
<code/>
<category/>
</establishment>
<board_type_code/>
<occupancy>
<adults>2</adults>
<children>1</children>
<rooms>1</rooms>
</occupancy>
</request>
</barceloDS_requests>
The XML Response Sample
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<barceloDS_responses xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/">
<response>
<request type="availability list" id="1">
<session_id>aaa6SP8c6P5BAJ
</session_
id>
<language_code>ING</langua
ge_code>
<agency>
<primary>888</primary>
<secondary>88</secondary>
<detail>888</detail>
<branch>1</branch>
</agency>
<contract/>
<check_in_date>20030706</c
heck_in_da
te>
<check_out_date>20030707</
check_out_
date>
<location>
<destination_code>PMI</des
tination_c
ode>
<zone_code/>
</location>
<establishment>
<code/>
<category/>
</establishment>
<board_type_code/>
<occupancy>
<adults>2</adults>
<children>1</children>
<rooms>1</rooms>
</occupancy>
</request>
<establishment>
<code>271</code>
<description>TRYP BELLVER</description>
<contract>3.V_BELLVER</con
tract>
<child_min_age>2</child_mi
n_age>
<child_max_age>12</child_m
ax_age>
<location>
<destination>
<code>PMI</code>
<description>MALLORCA</des
cription>
</destination>
<zone>
<code>10</code>
<description>PALMA</descri
ption>
</zone>
</location>
<category>
<code>4EST</code>
<description>4 STARS</description>
</category>
<incoming_contract>0</inco
ming_contr
act>
<offer>YES</offer>
<classification>SPE</class
ification>
<room>
<code>DBL.TE</code>
<description>DOBLE TERRACE</description>
<availability>997</availab
ility>
<type>P</type>
<occupancy>
<adults>2</adults>
<children>1</children>
<rooms>1</rooms>
</occupancy>
<price>
<board_type>
<code>SA</code>
<description>SELF CATERING</description>
</board_type>
<currency>EUR</currency>
<amount>14,08</amount>
</price>
<price>
<board_type>
<code>MP</code>
<description>HALF BOARD</description>
</board_type>
<currency>EUR</currency>
<amount>20,98</amount>
</price>
</room>
<room>
<code>A14.TE</code>
<description>APTO. 1 DORMITORIO 4 PAX TERRACE</description>
<availability>999</availab
ility>
<type>U</type>
<occupancy>
<adults>2</adults>
<children>1</children>
<rooms>1</rooms>
</occupancy>
<price>
<board_type>
<code>SA</code>
<description>SELF CATERING</description>
</board_type>
<currency>EUR</currency>
<amount>36,8</amount>
</price>
<price>
<board_type>
<code>MP</code>
<description>HALF BOARD</description>
</board_type>
<currency>EUR</currency>
<amount>57,5</amount>
</price>
</room>
</establishment>
<establishment>
<code>297</code>
<description>BARCELO PUEBLO PALMA</description>
<contract>3.VARIOS</contra
ct>
<child_min_age>2</child_mi
n_age>
<child_max_age>12</child_m
ax_age>
<location>
<destination>
<code>PMI</code>
<description>MALLORCA</des
cription>
</destination>
<zone>
<code>20</code>
<description>PLAYA DE PALMA</description>
</zone>
</location>
<category>
<code>3EST</code>
<description>3 STARS</description>
</category>
<incoming_contract>0</inco
ming_contr
act>
<offer>YES</offer>
<classification>SPE</class
ification>
<room>
<code>DBL.ST</code>
<description>DOBLE STANDARD</description>
<availability>994</availab
ility>
<type>P</type>
<occupancy>
<adults>2</adults>
<children>1</children>
<rooms>1</rooms>
</occupancy>
<price>
<board_type>
<code>MP</code>
<description>HALF BOARD</description>
</board_type>
<currency>EUR</currency>
<amount>16</amount>
</price>
</room>
</establishment>
</response>
</barceloDS_responses>
Thank you in advance for your help
Start Free Trial