XML - результаты поиска/Поиск туров/Интерфейс - Результаты поиска — различия между версиями

Материал из TourClient - Руководство пользователя
Перейти к: навигация, поиск
м
м
Строка 10: Строка 10:
  
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
<TourSearchRequest>
+
<Request>
     <dataOffset>0</dataOffset>
+
     <TourSearchRequest>
    <dataLimit>50</dataLimit>
+
        <dataOffset>0</dataOffset>
 
+
        <dataLimit>50</dataLimit>
     <seatStatus>3</seatStatus>
+
      
 
+
        <seatStatus>3</seatStatus>
     <cityId>1000</cityId>
+
      
    <countryId>12</countryId>
+
        <cityId>1000</cityId>
    <roomSizeId>14</roomSizeId>
+
        <countryId>12</countryId>
 
+
        <roomSizeId>14</roomSizeId>
     <adults>2</adults>
+
      
    <children>0</children>
+
        <adults>2</adults>
 
+
        <children>0</children>
     <childAge1>0</childAge1>
+
      
    <childAge2>0</childAge2>
+
        <childAge1>0</childAge1>
 
+
        <childAge2>0</childAge2>
     <durationFrom>7</durationFrom>
+
      
    <durationTill>14</durationTill>
+
        <durationFrom>7</durationFrom>
 
+
        <durationTill>14</durationTill>
     <departureFrom>2014-07-25</departureFrom>
+
      
    <departureTill>2014-08-10</departureTill>
+
        <departureFrom>2014-07-25</departureFrom>
 
+
        <departureTill>2014-08-10</departureTill>
     <ticket>1</ticket>
+
      
 
+
        <ticket>1</ticket>
     <priceFrom>500</priceFrom>
+
      
    <priceTill>50000</priceTill>
+
        <priceFrom>500</priceFrom>
    <currency>3</currency>
+
        <priceTill>50000</priceTill>
 
+
        <currency>3</currency>
     <operatorIds>
+
      
        <id>111</id>
+
        <operatorIds>
        <id>222</id>
+
            <id>111</id>
        <id>333</id>
+
            <id>222</id>
    </operatorIds>
+
            <id>333</id>
 
+
        </operatorIds>
     <resortIds>
+
      
        <id>111</id>
+
        <resortIds>
        <id>222</id>
+
            <id>111</id>
        <id>333</id>
+
            <id>222</id>
    </resortIds>
+
            <id>333</id>
 
+
        </resortIds>
    <resortPlaceIds>
+
   
        <id>111</id>
+
        <resortPlaceIds>
        <id>222</id>
+
            <id>111</id>
        <id>333</id>
+
            <id>222</id>
    </resortPlaceIds>
+
            <id>333</id>
 
+
        </resortPlaceIds>
     <allocCatId>7</allocCatId>
+
      
    <allocRate>3.56</allocRate>
+
        <allocCatId>7</allocCatId>
 
+
        <allocRate>3.56</allocRate>
     <allocationIds>
+
      
        <id>111</id>
+
        <allocationIds>
        <id>222</id>
+
            <id>111</id>
        <id>333</id>
+
            <id>222</id>
    </allocationIds>
+
            <id>333</id>
 
+
        </allocationIds>
     <mealIds>
+
      
        <id>111</id>
+
        <mealIds>
        <id>222</id>
+
            <id>111</id>
        <id>333</id>
+
            <id>222</id>
    </mealIds>
+
            <id>333</id>
 
+
        </mealIds>
    <roomViewIds>
+
   
        <id>111</id>
+
        <roomViewIds>
        <id>222</id>
+
            <id>111</id>
        <id>333</id>
+
            <id>222</id>
    </roomViewIds>
+
            <id>333</id>
 
+
        </roomViewIds>
     <roomTypeIds>
+
      
        <id>111</id>
+
        <roomTypeIds>
        <id>222</id>
+
            <id>111</id>
        <id>333</id>
+
            <id>222</id>
    </roomTypeIds>
+
            <id>333</id>
 
+
        </roomTypeIds>
</TourSearchRequest>
+
   
<TourExtraEntities>
+
    </TourSearchRequest>
    <entity>OnlineSeatsState</entity>
+
    <TourExtraEntities>
    <entity>ExtraCharges</entity>
+
        <entity>OnlineSeatsState</entity>
    <entity>City</entity>
+
        <entity>ExtraCharges</entity>
    <entity>Country</entity>
+
        <entity>City</entity>
    <entity>RoomSize</entity>
+
        <entity>Country</entity>
    <entity>Resort</entity>
+
        <entity>RoomSize</entity>
    <entity>ResortPlace</entity>
+
        <entity>Resort</entity>
    <entity>Allocation</entity>
+
        <entity>ResortPlace</entity>
    <entity>AllocCat</entity>
+
        <entity>Allocation</entity>
    <entity>Meal</entity>
+
        <entity>AllocCat</entity>
    <entity>RoomType</entity>
+
        <entity>Meal</entity>
    <entity>RoomView</entity>
+
        <entity>RoomType</entity>
    <entity>Operator</entity>
+
        <entity>RoomView</entity>
</TourExtraEntities>
+
        <entity>Operator</entity>
 +
    </TourExtraEntities>
 +
</Request>
  
 
</source>
 
</source>

Версия 16:08, 8 июля 2014

Работа с сервисом осуществляется путем отправки POST запросов на адрес http://tourclient.ru/f/exml/user_id/tours_export .

Параметр request должен содержать xml запроса.

В результате сервис вернет ответ в формате xml.

Запрос к сервису

<?xml version="1.0" encoding="UTF-8"?>
<Request>
    <TourSearchRequest>
        <dataOffset>0</dataOffset>
        <dataLimit>50</dataLimit>
 
        <seatStatus>3</seatStatus>
 
        <cityId>1000</cityId>
        <countryId>12</countryId>
        <roomSizeId>14</roomSizeId>
 
        <adults>2</adults>
        <children>0</children>
 
        <childAge1>0</childAge1>
        <childAge2>0</childAge2>
 
        <durationFrom>7</durationFrom>
        <durationTill>14</durationTill>
 
        <departureFrom>2014-07-25</departureFrom>
        <departureTill>2014-08-10</departureTill>
 
        <ticket>1</ticket>
 
        <priceFrom>500</priceFrom>
        <priceTill>50000</priceTill>
        <currency>3</currency>
 
        <operatorIds>
            <id>111</id>
            <id>222</id>
            <id>333</id>
        </operatorIds>
 
        <resortIds>
            <id>111</id>
            <id>222</id>
            <id>333</id>
        </resortIds>
 
        <resortPlaceIds>
            <id>111</id>
            <id>222</id>
            <id>333</id>
        </resortPlaceIds>
 
        <allocCatId>7</allocCatId>
        <allocRate>3.56</allocRate>
 
        <allocationIds>
            <id>111</id>
            <id>222</id>
            <id>333</id>
        </allocationIds>
 
        <mealIds>
            <id>111</id>
            <id>222</id>
            <id>333</id>
        </mealIds>
 
        <roomViewIds>
            <id>111</id>
            <id>222</id>
            <id>333</id>
        </roomViewIds>
 
        <roomTypeIds>
            <id>111</id>
            <id>222</id>
            <id>333</id>
        </roomTypeIds>
 
    </TourSearchRequest>
    <TourExtraEntities>
        <entity>OnlineSeatsState</entity>
        <entity>ExtraCharges</entity>
        <entity>City</entity>
        <entity>Country</entity>
        <entity>RoomSize</entity>
        <entity>Resort</entity>
        <entity>ResortPlace</entity>
        <entity>Allocation</entity>
        <entity>AllocCat</entity>
        <entity>Meal</entity>
        <entity>RoomType</entity>
        <entity>RoomView</entity>
        <entity>Operator</entity>
    </TourExtraEntities>
</Request>


Ответ сервиса

Сервис возвращает ответ, содержащий массив объектов Тур (Tours) и объект Статус поиска (SearchStatus)

<?xml version="1.0" encoding="UTF-8"?>
<Result>
    <Tours>
        <Tour>...</Tour>
        <Tour>...</Tour>
        <Tour>...</Tour>
        ...
    </Tours>
    <SearchStatus>
       ...
    </SearchStatus>
</Result>