如何显示所有SOAP服务数据?

时间:2015-11-13 14:44:29

标签: php xml web-services soap

我必须使用服务租赁汽车,但想要使用数据,而不是所有数据。

使用__getLastResponse()功能。它显示响应包含所有数据。

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body><OTA_VehLocDetailRS TimeStamp="2015-11-13T14:38:00" TransactionIdentifier="100000001" SequenceNmbr="1" Target="Production" Version="3.0" xmlns="http://www.opentravel.org/OTA/2003/05">
  <Success/>
  <LocationDetail Code="MIAT71" AtAirport="true" Name="Miami Intl Arpt">
    <Address>
      <AddressLine>3900 Nw 25th St</AddressLine>
      <StateProv StateCode="FL"/>
      <CountryName Code="US"/>
    </Address>
    <Telephone PhoneTechType="1" AreaCityCode="888" PhoneNumber="826-6893 ext:MAIN"/>
    <Telephone PhoneTechType="1" AreaCityCode="305" PhoneNumber="633-6076 ext:LOCAL"/>
    <Telephone PhoneTechType="1" AreaCityCode="305" PhoneNumber="635-3291"/>
  </LocationDetail>
  <Vehicles>
    <Vehicle  TransmissionType="Automatic" AirConditionInd="true" BaggageQuantity="2" PassengerQuantity="4">
      <VehType VehicleCategory="1"/>
      <VehClass Size="3"/>
      <VehMakeModel Name="CHEVROLET SPARK or similar" Code="ECAR"/>
      <PictureURL>https://assets.alamo.com/alamoData/vehicle/bookingCountries/US/CARS/ECAR.doi.320.high.imageLargeThreeQuarterNodePath.png/1427393759663.png</PictureURL>
    </Vehicle>
    <Vehicle  TransmissionType="Automatic" AirConditionInd="true" BaggageQuantity="2" PassengerQuantity="5">
      <VehType VehicleCategory="1" DoorCount="4"/>
      <VehClass Size="3"/>
      <VehMakeModel Name="4 DR HATCHBACK or similar" Code="EDAR"/>
      <PictureURL>https://assets.alamo.com/alamoData/vehicle/bookingCountries/US/CARS/EDAR.doi.320.high.imageLargeThreeQuarterNodePath.png/1398181732594.png</PictureURL>
    </Vehicle>
    <Vehicle  TransmissionType="Automatic" AirConditionInd="true" BaggageQuantity="2" PassengerQuantity="4">
      <VehType VehicleCategory="1"/>
      <VehClass Size="4"/>
      <VehMakeModel Name="NISSAN VERSA or similar" Code="CCAR"/>
      <PictureURL>https://assets.alamo.com/alamoData/vehicle/bookingCountries/US/CARS/CCAR.doi.320.high.imageLargeThreeQuarterNodePath.png/1423755550651.png</PictureURL>
    </Vehicle>
    <Vehicle  TransmissionType="Automatic" AirConditionInd="true" BaggageQuantity="2" PassengerQuantity="5">
      <VehType VehicleCategory="1" DoorCount="4"/>
      <VehClass Size="4"/>
      <VehMakeModel Name="VERSA 4DR 1.8S or similar" Code="CDAR"/>
      <PictureURL>https://assets.alamo.com/alamoData/vehicle/bookingCountries/US/CARS/CDAR.doi.320.high.imageLargeThreeQuarterNodePath.png/1398181723781.png</PictureURL>
    </Vehicle>
    <Vehicle  TransmissionType="Automatic" AirConditionInd="true" BaggageQuantity="2" PassengerQuantity="5">
      <VehType VehicleCategory="1"/>
      <VehClass Size="6"/>
      <VehMakeModel Name="COROLLA or similar" Code="ICAR"/>
      <PictureURL>https://assets.alamo.com/alamoData/vehicle/bookingCountries/US/CARS/ICAR.doi.320.high.imageLargeThreeQuarterNodePath.png/1444490304593.png</PictureURL>
    </Vehicle>
    <Vehicle  TransmissionType="Automatic" AirConditionInd="true" BaggageQuantity="2" PassengerQuantity="5">
      <VehType VehicleCategory="1" DoorCount="4"/>
      <VehClass Size="6"/>
      <VehMakeModel Name="COROLLA 4DR S or similar" Code="IDAR"/>
      <PictureURL>https://assets.alamo.com/alamoData/vehicle/bookingCountries/US/CARS/IDAR.doi.320.high.imageLargeThreeQuarterNodePath.png/1398181728446.png</PictureURL>
    </Vehicle>
    <Vehicle  TransmissionType="Automatic" AirConditionInd="true" BaggageQuantity="4" PassengerQuantity="5">
      <VehType VehicleCategory="1"/>
      <VehClass Size="7"/>
      <VehMakeModel Name="CHRYSLER 200 or similar" Code="SCAR"/>
      <PictureURL>https://assets.alamo.com/alamoData/vehicle/bookingCountries/US/CARS/SCAR.doi.320.high.imageLargeThreeQuarterNodePath.png/1424187500900.png</PictureURL>
    </Vehicle>
    <Vehicle  TransmissionType="Automatic" AirConditionInd="true" BaggageQuantity="4" PassengerQuantity="5">
      <VehType VehicleCategory="1" DoorCount="4"/>
      <VehClass Size="7"/>
      <VehMakeModel Name="200 LX or similar" Code="SDAR"/>
      <PictureURL>https://assets.alamo.com/alamoData/vehicle/bookingCountries/US/CARS/SDAR.doi.320.high.imageLargeThreeQuarterNodePath.png/1398181815450.png</PictureURL>
    </Vehicle>
    <Vehicle  TransmissionType="Automatic" AirConditionInd="true" BaggageQuantity="5" PassengerQuantity="5">
      <VehType VehicleCategory="1"/>
      <VehClass Size="8"/>
      <VehMakeModel Name="FUSION or similar" Code="FCAR"/>
      <PictureURL>https://assets.alamo.com/alamoData/vehicle/bookingCountries/US/CARS/FCAR.doi.320.high.imageLargeThreeQuarterNodePath.png/1424184197004.png</PictureURL>
    </Vehicle>
    <Vehicle  TransmissionType="Automatic" AirConditionInd="true">
      <VehType VehicleCategory="1" DoorCount="4"/>
      <VehClass Size="8"/>
      <VehMakeModel Name="FUSION or similar" Code="FDAR"/>
      <PictureURL>https://assets.alamo.com/content/dam/global-vehicle-images/na/na-image-not-available-330x190-angle.png</PictureURL>
    </Vehicle>

  </Vehicles>
  <Requirements>
    <PaymentOptions>
      <CreditCard>
        <AcceptablePaymentCards>
          <AcceptablePaymentCard CardType="AX"/>
          <AcceptablePaymentCard CardType="DS"/>
          <AcceptablePaymentCard CardType="MC"/>
          <AcceptablePaymentCard CardType="VI"/>
        </AcceptablePaymentCards>
      </CreditCard>
      <DebitCard>
        <Info>
          <SubSection>
            <Paragraph>
              <Text>ALAMO RENT A CAR REQUIRES RENTER TO PRESENT A MAJOR CREDIT CARD OR DEBIT CARD IN THEIR OWN NAME AT TIME OF RENTAL OR SPECIAL CASH REQUIREMENTS APPLY. - DEBIT CARD MUST DISPLAY VISA OR MASTER CARD LOGO - DEBIT AND CHECK CARDS MAY ONLY BE USED IN CONJUNCTION WITH PROOF OF A ROUND TRIP TRAVEL TICKET ** AIRLINE, CRUISE SHIP, AND THE LIKE **. WITHOUT PROOF OF ROUNDTRIP TICKET, DEBIT AND CHECK CARDS ARE ONLY ACCEPTED ON RETURN. LOCATIONS IN CONNECTICUT, MANHATTAN, NEW YORK AND CAMBRIDGE, MA DO NOT ACCEPT DEBIT CARDS AT THE TIME OF RENTAL AND ONLY ACCEPT DEBIT CARDS ON RETURN.</Text>
            </Paragraph>
          </SubSection>
        </Info>
      </DebitCard>
    </PaymentOptions>
  </Requirements>
  <ServicesOffered>
    <SpecialEquipments>
      <SpecialEquipment Type="9">
        <EquipDesc>
          <SubSection SubTitle="StatusSubSection" >
            <Paragraph Name="StatusParagraph"><Text>F</Text></Paragraph>
          </SubSection>         
        </EquipDesc>
        <EquipCharges>
          <EquipCharge GuaranteedInd="false" IncludedInRate="false" CurrencyCode="USD">
            <Calculation UnitName="Day" UnitCharge="9.99"/>
            <Calculation UnitName="RentalPeriod" UnitCharge="60.0"/>
          </EquipCharge>
        </EquipCharges>
      </SpecialEquipment>
      <SpecialEquipment Type="59">
        <EquipDesc>
          <SubSection SubTitle="StatusSubSection" >
            <Paragraph Name="StatusParagraph"><Text>F</Text></Paragraph>
          </SubSection>         
        </EquipDesc>
        <EquipCharges>
          <EquipCharge GuaranteedInd="false" IncludedInRate="false" CurrencyCode="USD">
            <Calculation UnitName="RentalPeriod" UnitCharge="1.25"/>
          </EquipCharge>
        </EquipCharges>
      </SpecialEquipment>
      <SpecialEquipment Type="7">
        <EquipDesc>
          <SubSection SubTitle="StatusSubSection" >
            <Paragraph Name="StatusParagraph"><Text>F</Text></Paragraph>
          </SubSection>         
        </EquipDesc>
        <EquipCharges>
          <EquipCharge GuaranteedInd="false" IncludedInRate="false" CurrencyCode="USD">
            <Calculation UnitName="Day" UnitCharge="9.99"/>
            <Calculation UnitName="RentalPeriod" UnitCharge="60.0"/>
          </EquipCharge>
        </EquipCharges>
      </SpecialEquipment>
      <SpecialEquipment Type="8">
        <EquipDesc>
          <SubSection SubTitle="StatusSubSection" >
            <Paragraph Name="StatusParagraph"><Text>F</Text></Paragraph>
          </SubSection>         
        </EquipDesc>
        <EquipCharges>
          <EquipCharge GuaranteedInd="false" IncludedInRate="false" CurrencyCode="USD">
            <Calculation UnitName="Day" UnitCharge="9.99"/>
            <Calculation UnitName="RentalPeriod" UnitCharge="60.0"/>
          </EquipCharge>
        </EquipCharges>
      </SpecialEquipment>
      <SpecialEquipment Type="13">
        <EquipDesc>
          <SubSection SubTitle="StatusSubSection" >
            <Paragraph Name="StatusParagraph"><Text>F</Text></Paragraph>
          </SubSection>         
        </EquipDesc>
        <EquipCharges>
          <EquipCharge GuaranteedInd="false" IncludedInRate="false" CurrencyCode="USD">
            <Calculation UnitName="Day" UnitCharge="11.99"/>
            <Calculation UnitName="Week" UnitCharge="69.65"/>
            <Calculation UnitName="RentalPeriod" UnitCharge="179.99"/>
          </EquipCharge>
        </EquipCharges>
      </SpecialEquipment>
      <SpecialEquipment Type="12">
        <EquipDesc>
          <SubSection SubTitle="StatusSubSection" >
            <Paragraph Name="StatusParagraph"><Text>R</Text></Paragraph>
          </SubSection>         
        </EquipDesc>
        <EquipCharges>
          <EquipCharge GuaranteedInd="false" IncludedInRate="false" CurrencyCode="USD">
          </EquipCharge>
        </EquipCharges>
      </SpecialEquipment>
      <SpecialEquipment Type="11">
        <EquipDesc>
          <SubSection SubTitle="StatusSubSection" >
            <Paragraph Name="StatusParagraph"><Text>R</Text></Paragraph>
          </SubSection>         
        </EquipDesc>
        <EquipCharges>
          <EquipCharge GuaranteedInd="false" IncludedInRate="false" CurrencyCode="USD">
          </EquipCharge>
        </EquipCharges>
      </SpecialEquipment>
      <SpecialEquipment Type="34">
        <EquipDesc>
          <SubSection SubTitle="StatusSubSection" >
            <Paragraph Name="StatusParagraph"><Text>F</Text></Paragraph>
          </SubSection>         
        </EquipDesc>
        <EquipCharges>
          <EquipCharge GuaranteedInd="false" IncludedInRate="false" CurrencyCode="USD">
            <Calculation UnitName="Day" UnitCharge="21.990000000000002"/>
          </EquipCharge>
        </EquipCharges>
      </SpecialEquipment>
    </SpecialEquipments>
  </ServicesOffered>
</OTA_VehLocDetailRS>
</env:Body></env:Envelope>

但要在我可以使用的响应中获取数据的打印输出,请告诉我: varDump()

array(1) {
  [0]=>
  object(stdClass)#4 (10) {
    ["Success"]=>
    object(stdClass)#5 (0) {
    }
    ["LocationDetail"]=>
    object(stdClass)#6 (5) {
      ["Address"]=>
      object(stdClass)#7 (3) {
        ["AddressLine"]=>
        string(15) "3900 Nw 25th St"
        ["StateProv"]=>
        string(0) ""
        ["CountryName"]=>
        string(0) ""
      }
      ["Telephone"]=>
      array(3) {
        [0]=>
        object(stdClass)#8 (0) {
        }
        [1]=>
        object(stdClass)#9 (0) {
        }
        [2]=>
        object(stdClass)#10 (0) {
        }
      }
      ["AtAirport"]=>
      bool(true)
      ["Code"]=>
      string(6) "MIAT71"
      ["Name"]=>
      string(15) "Miami Intl Arpt"
    }
    ["Vehicles"]=>
    object(stdClass)#11 (1) {
      ["Vehicle"]=>
      array(46) {
        [0]=>
        object(stdClass)#12 (0) {
        }
        [1]=>
        object(stdClass)#13 (0) {
        }
        [2]=>
        object(stdClass)#14 (0) {
        }
        [3]=>
        object(stdClass)#15 (0) {
        }
        [4]=>
        object(stdClass)#16 (0) {
        }
        [5]=>
        object(stdClass)#17 (0) {
        }
        [6]=>
        object(stdClass)#18 (0) {
        }
        [7]=>
        object(stdClass)#19 (0) {
        }
        [8]=>
        object(stdClass)#20 (0) {
        }
        [9]=>
        object(stdClass)#21 (0) {
        }
        [10]=>
        object(stdClass)#22 (0) {
        }

      }
    }
    ["Requirements"]=>
    object(stdClass)#58 (1) {
      ["PaymentOptions"]=>
      object(stdClass)#59 (2) {
        ["CreditCard"]=>
        object(stdClass)#60 (1) {
          ["AcceptablePaymentCards"]=>
          object(stdClass)#61 (1) {
            ["AcceptablePaymentCard"]=>
            array(4) {
              [0]=>
              object(stdClass)#62 (0) {
              }
              [1]=>
              object(stdClass)#63 (0) {
              }
              [2]=>
              object(stdClass)#64 (0) {
              }
              [3]=>
              object(stdClass)#65 (0) {
              }
            }
          }
        }
        ["DebitCard"]=>
        object(stdClass)#66 (1) {
          ["Info"]=>
          object(stdClass)#67 (1) {
            ["SubSection"]=>
            object(stdClass)#68 (1) {
              ["Paragraph"]=>
              object(stdClass)#69 (1) {
                ["Text"]=>
                string(576) "ALAMO RENT A CAR REQUIRES RENTER TO PRESENT A MAJOR CREDIT CARD OR DEBIT CARD IN THEIR OWN NAME AT TIME OF RENTAL OR SPECIAL CASH REQUIREMENTS APPLY. - DEBIT CARD MUST DISPLAY VISA OR MASTER CARD LOGO - DEBIT AND CHECK CARDS MAY ONLY BE USED IN CONJUNCTION WITH PROOF OF A ROUND TRIP TRAVEL TICKET ** AIRLINE, CRUISE SHIP, AND THE LIKE **. WITHOUT PROOF OF ROUNDTRIP TICKET, DEBIT AND CHECK CARDS ARE ONLY ACCEPTED ON RETURN. LOCATIONS IN CONNECTICUT, MANHATTAN, NEW YORK AND CAMBRIDGE, MA DO NOT ACCEPT DEBIT CARDS AT THE TIME OF RENTAL AND ONLY ACCEPT DEBIT CARDS ON RETURN."
              }
            }
          }
        }
      }
    }
    ["ServicesOffered"]=>
    object(stdClass)#70 (1) {
      ["SpecialEquipments"]=>
      object(stdClass)#71 (1) {
        ["SpecialEquipment"]=>
        array(8) {
          [0]=>
          object(stdClass)#72 (3) {
            ["EquipDesc"]=>
            object(stdClass)#73 (1) {
              ["SubSection"]=>
              object(stdClass)#74 (1) {
                ["Paragraph"]=>
                object(stdClass)#75 (1) {
                  ["Text"]=>
                  string(1) "F"
                }
              }
            }
            ["EquipCharges"]=>
            object(stdClass)#76 (1) {
              ["EquipCharge"]=>
              object(stdClass)#77 (3) {
                ["Calculation"]=>
                array(2) {
                  [0]=>
                  object(stdClass)#78 (2) {
                    ["UnitCharge"]=>
                    string(4) "9.99"
                    ["UnitName"]=>
                    string(3) "Day"
                  }
                  [1]=>
                  object(stdClass)#79 (2) {
                    ["UnitCharge"]=>
                    string(4) "60.0"
                    ["UnitName"]=>
                    string(12) "RentalPeriod"
                  }
                }
                ["GuaranteedInd"]=>
                bool(false)
                ["IncludedInRate"]=>
                bool(false)
              }
            }
            ["Type"]=>
            string(1) "9"
          }

        }
      }
    }
    ["TimeStamp"]=>
    string(19) "2015-11-13T14:38:00"
    ["Target"]=>
    string(10) "Production"
    ["Version"]=>
    string(3) "3.0"
    ["TransactionIdentifier"]=>
    string(9) "100000001"
    ["SequenceNmbr"]=>
    int(1)
  }
}

想要使用我无需打印的数据。

0 个答案:

没有答案