Bono de reserva (getBookingVoucher)
El método getBookingVoucher devuelve el bono de una reserva en formato PDF, listo para entregar al viajero.
Parámetros
Sección titulada «Parámetros»| Parámetro | Obligatorio | Descripción |
|---|---|---|
authenticationData |
Sí | Credenciales (ver autenticación). |
bookingReference |
Sí | Localizador de la reserva. |
Ejemplo
Sección titulada «Ejemplo»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-b08346d258f5Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"Content-Transfer-Encoding: binaryContent-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-b08346d258f5Content-Type: application/pdfContent-Transfer-Encoding: binaryContent-ID: <7e1f5a2c-1b3d-4c9e-9f0a-2d8b6c4e1a77-1@cxf.apache.org>
%PDF-1.7 ... (contenido binario del PDF)--uuid:0c51d204-e832-4e45-b9e0-b08346d258f5--Respuesta
Sección titulada «Respuesta»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.
Errores
Sección titulada «Errores»Esta operación devuelve un fault genérico: el código de error va al final de faultstring. Ver Códigos de error.
Siguientes pasos
Sección titulada «Siguientes pasos» getBooking → Consulta el detalle completo de la reserva.
Códigos de error → Consulta el formato de los errores del servicio.