Как войти XML-запрос от Strong-Soap - PullRequest
0 голосов
/ 10 апреля 2019

Я использую модуль узла strong-soap для выполнения запросов мыла в nodeJs.

Запрос мыла работает прекрасно, но это структура объекта js, который создает запрос xml, с которым у меня возникают проблемы.Я спрашиваю, как можно зарегистрировать запрос XML, созданный сильным мылом, чтобы я мог исправить объект JS.

Это мой объект, если кто-нибудь может помочь:

  var requestArgs = {
            clientInformation: {
                clientIP: "129.0.0.1",
                member: [],
                password: "TEST",
                preferredCurrency: "TND",
                preferredLanguage: "FR",
                userName: "TEST"
            },
            originDestinationInformationList: {
                dateOffset: 0,
                departureDateTime: "2019-05-02",
                destinationLocation: {
                    locationCode: "CDG"
                },
                flexibleFaresOnly: false,
                includeInterlineFlights: false,
                openFlight: false,
                originLocation: {
                    locationCode: "TUN"
                }
            },
            travelerInformation: {
                passengerTypeQuantityList: {
                    hasStrecher: [],
                    passengerType: {
                        code: "ADLT"
                    },
                    quantity: 1
                }
            },
            tripType: "ONE_WAY"
  };

и этотакое тело XML, которое я ищу:

<soapenv:Body>
     <impl:GetAirAvailability>
     <!--Optional:-->
     <AirAvailabilityRequest>          
        <clientInformation>
           <clientIP>129.0.0.1</clientIP>
           <member></member>
           <password>TEST</password>
           <preferredCurrency>TND</preferredCurrency>
           <preferredLanguage>FR</preferredLanguage>
           <userName>TEST</userName>
        </clientInformation>
        <originDestinationInformationList>
           <dateOffset>0</dateOffset>
           <departureDateTime>2019-05-02</departureDateTime>
           <destinationLocation>
              <locationCode>CDG</locationCode>
           </destinationLocation>
           <flexibleFaresOnly>false</flexibleFaresOnly>
           <includeInterlineFlights>false</includeInterlineFlights>
           <openFlight>false</openFlight>
           <originLocation>
              <locationCode>TUN</locationCode>
           </originLocation>
        </originDestinationInformationList>
        <travelerInformation>
           <passengerTypeQuantityList>
              <hasStrecher/>
              <passengerType>
                 <code>ADLT</code>
              </passengerType>
              <quantity>1</quantity>
           </passengerTypeQuantityList>               
        </travelerInformation>
        <tripType>ONE_WAY</tripType>
     </AirAvailabilityRequest>
     </impl:GetAirAvailability>
   </soapenv:Body>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...