如何从Strong-Soap记录xml请求?

时间:2019-04-10 15:23:46

标签: node.js soap strong-soap

我正在使用强肥皂节点模块在nodeJs中进行肥皂请求。

soap请求工作得很好,但是它的js对象的结构创建了我遇到麻烦的xml请求。 我在问如何记录Strong-Soap生成的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>

0 个答案:

没有答案
相关问题