Ir al contenido

Bono de reserva (getBookingVoucher)

El método getBookingVoucher devuelve el bono de una reserva en formato PDF, listo para entregar al viajero.


Parámetro Obligatorio Descripción
authenticationData Sí Credenciales (ver autenticación).
bookingReference Sí Localizador de la reserva.

Code getBookingVoucher

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bar="http://barcelo.ws.barcelo.com/">
<soapenv:Header/>
<soapenv:Body>
<bar:getBookingVoucher>
<authenticationData>
<bar:user>USUARIO</bar:user>
<bar:password>CLAVE</bar:password>
<bar:locale>es_ES</bar:locale>
<bar:domain>barcelo</bar:domain>
</authenticationData>
<bookingReference>12345678</bookingReference>
</bar:getBookingVoucher>
</soapenv:Body>
</soapenv:Envelope>

Response getBookingVoucher

La respuesta es un mensaje multipart MTOM. El PDF viaja como adjunto binario y el cuerpo SOAP lo referencia con xop:Include:

--uuid:0c51d204-e832-4e45-b9e0-b08346d258f5
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <root.message@cxf.apache.org>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:getBookingVoucherResponse xmlns:ns2="http://barcelo.ws.barcelo.com/">
<voucher>
<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:7e1f5a2c-1b3d-4c9e-9f0a-2d8b6c4e1a77-1@cxf.apache.org"/>
</voucher>
</ns2:getBookingVoucherResponse>
</soap:Body>
</soap:Envelope>
--uuid:0c51d204-e832-4e45-b9e0-b08346d258f5
Content-Type: application/pdf
Content-Transfer-Encoding: binary
Content-ID: <7e1f5a2c-1b3d-4c9e-9f0a-2d8b6c4e1a77-1@cxf.apache.org>
%PDF-1.7 ... (contenido binario del PDF)
--uuid:0c51d204-e832-4e45-b9e0-b08346d258f5--

El elemento voucher (tipo base64Binary en el WSDL) contiene el PDF. Los clientes con soporte MTOM lo reciben como adjunto binario; los clientes sin soporte MTOM lo reciben codificado en base64 dentro del propio elemento.


Esta operación devuelve un fault genérico: el código de error va al final de faultstring. Ver Códigos de error.