Partilhar via


Processar uma mensagem de Consulta

Se se inscrever em pedidos Pull ou solicitar pedidos de sugestões, a Microsoft envia-lhe uma mensagem de Consulta que especifica os dados de itinerário que precisa de enviar na sua próxima mensagem de Transação .

Utilizar pedidos Pull

Se utilizar pedidos Pull, a Microsoft poderá enviar-lhe um pedido semelhante à seguinte mensagem de Consulta.

<?xml version="1.0" encoding="UTF-8"?>
<Query>
  <Checkin>2017-10-20</FirstDate>
  <Nights>1</Nights>

  <PropertyList>
    <Property>223</Property>
    <Property>256</Property>
    <Property>289</Property>
  </PropertyList>
</Query>

Dependendo do número de hotéis que tem, a Microsoft pode dividir a consulta em várias consultas mais pequenas com cada consulta que contém um subconjunto dos hotéis na lista de propriedades.

Quando receber a mensagem Consulta, a sua resposta deverá conter uma Mensagem de transação com o seguinte <Resultado>.

  <Result>
    <Property>223</Property>
    <Checkin>2017-10-20</Checkin>
    <Nights>1</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>223</Property>
    <Checkin>2017-10-20</Checkin>
    <Nights>2</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>223</Property>
    <Checkin>2017-10-20</Checkin>
    <Nights>3</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  
  . . .
  
  <Result>
    <Property>223</Property>
    <Checkin>2017-10-30</Checkin>
    <Nights>1</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>223</Property>
    <Checkin>2017-10-30</Checkin>
    <Nights>2</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>223</Property>
    <Checkin>2017-10-30</Checkin>
    <Nights>3</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  
  . . .
  
  <Result>
    <Property>256</Property>
    <Checkin>2017-10-20</Checkin>
    <Nights>1</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>256</Property>
    <Checkin>2017-10-20</Checkin>
    <Nights>2</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>256</Property>
    <Checkin>2017-10-20</Checkin>
    <Nights>3</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>

  . . .
    

Utilizar o pull com pedidos de sugestões

Para obter exemplos que mostram os diferentes tipos de mensagens de Consulta que a Microsoft envia se utilizar o pedido Pull com sugestões, consulte Criar uma Mensagem de Sugestão.