- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试使用 XmlSerializer 将 XML 解析为 c# 对象:
XmlSerializer serialize = new XmlSerializer(typeof(Xml2CSharp.LowFareSearchCorpRsp));
StringReader rdr = new StringReader(tmpRes);
Xml2CSharp.LowFareSearchCorpRsp res = (Xml2CSharp.LowFareSearchCorpRsp)serializer.Deserialize(rdr);
然后我收到下一条错误消息:
InnerException = {"LowFareSearchRsp xmlns='' was not expected."}
这是对象:
using System;
using System.Xml.Serialization;
using System.Collections.Generic;
namespace Xml2CSharp
{
[XmlRoot(ElementName = "FlightDetails")]
public class FlightDetails
{
[XmlAttribute(AttributeName = "Key")]
public string Key { get; set; }
[XmlAttribute(AttributeName = "Origin")]
public string Origin { get; set; }
[XmlAttribute(AttributeName = "Destination")]
public string Destination { get; set; }
[XmlAttribute(AttributeName = "DepartureTime")]
public string DepartureTime { get; set; }
[XmlAttribute(AttributeName = "ArrivalTime")]
public string ArrivalTime { get; set; }
[XmlAttribute(AttributeName = "FlightTime")]
public string FlightTime { get; set; }
[XmlAttribute(AttributeName = "TravelTime")]
public string TravelTime { get; set; }
[XmlAttribute(AttributeName = "Equipment")]
public string Equipment { get; set; }
[XmlAttribute(AttributeName = "DestinationTerminal")]
public string DestinationTerminal { get; set; }
}
[XmlRoot(ElementName = "FlightDetailsList")]
public class FlightDetailsList
{
[XmlElement(ElementName = "FlightDetails")]
public List<FlightDetails> FlightDetails { get; set; }
}
[XmlRoot(ElementName = "BookingCodeInfo")]
public class BookingCodeInfo
{
[XmlAttribute(AttributeName = "BookingCounts")]
public string BookingCounts { get; set; }
}
[XmlRoot(ElementName = "AirAvailInfo")]
public class AirAvailInfo
{
[XmlElement(ElementName = "BookingCodeInfo")]
public BookingCodeInfo BookingCodeInfo { get; set; }
[XmlAttribute(AttributeName = "ProviderCode")]
public string ProviderCode { get; set; }
}
[XmlRoot(ElementName = "FlightDetailsRef")]
public class FlightDetailsRef
{
[XmlAttribute(AttributeName = "Key")]
public string Key { get; set; }
}
[XmlRoot(ElementName = "AirSegment")]
public class AirSegment
{
[XmlElement(ElementName = "AirAvailInfo")]
public AirAvailInfo AirAvailInfo { get; set; }
[XmlElement(ElementName = "FlightDetailsRef")]
public FlightDetailsRef FlightDetailsRef { get; set; }
[XmlAttribute(AttributeName = "Key")]
public string Key { get; set; }
[XmlAttribute(AttributeName = "Group")]
public string Group { get; set; }
[XmlAttribute(AttributeName = "Carrier")]
public string Carrier { get; set; }
[XmlAttribute(AttributeName = "FlightNumber")]
public string FlightNumber { get; set; }
[XmlAttribute(AttributeName = "Origin")]
public string Origin { get; set; }
[XmlAttribute(AttributeName = "Destination")]
public string Destination { get; set; }
[XmlAttribute(AttributeName = "DepartureTime")]
public string DepartureTime { get; set; }
[XmlAttribute(AttributeName = "ArrivalTime")]
public string ArrivalTime { get; set; }
[XmlAttribute(AttributeName = "FlightTime")]
public string FlightTime { get; set; }
[XmlAttribute(AttributeName = "Distance")]
public string Distance { get; set; }
[XmlAttribute(AttributeName = "ETicketability")]
public string ETicketability { get; set; }
[XmlAttribute(AttributeName = "Equipment")]
public string Equipment { get; set; }
[XmlAttribute(AttributeName = "ChangeOfPlane")]
public string ChangeOfPlane { get; set; }
[XmlAttribute(AttributeName = "ParticipantLevel")]
public string ParticipantLevel { get; set; }
[XmlAttribute(AttributeName = "LinkAvailability")]
public string LinkAvailability { get; set; }
[XmlAttribute(AttributeName = "PolledAvailabilityOption")]
public string PolledAvailabilityOption { get; set; }
[XmlAttribute(AttributeName = "OptionalServicesIndicator")]
public string OptionalServicesIndicator { get; set; }
[XmlAttribute(AttributeName = "AvailabilitySource")]
public string AvailabilitySource { get; set; }
[XmlAttribute(AttributeName = "AvailabilityDisplayType")]
public string AvailabilityDisplayType { get; set; }
[XmlElement(ElementName = "CodeshareInfo")]
public CodeshareInfo CodeshareInfo { get; set; }
}
[XmlRoot(ElementName = "CodeshareInfo")]
public class CodeshareInfo
{
[XmlAttribute(AttributeName = "OperatingCarrier")]
public string OperatingCarrier { get; set; }
[XmlAttribute(AttributeName = "OperatingFlightNumber")]
public string OperatingFlightNumber { get; set; }
[XmlText]
public string Text { get; set; }
}
[XmlRoot(ElementName = "AirSegmentList")]
public class AirSegmentList
{
[XmlElement(ElementName = "AirSegment")]
public List<AirSegment> AirSegment { get; set; }
}
[XmlRoot(ElementName = "BaggageAllowance")]
public class BaggageAllowance
{
[XmlElement(ElementName = "NumberOfPieces")]
public string NumberOfPieces { get; set; }
[XmlElement(ElementName = "MaxWeight")]
public string MaxWeight { get; set; }
}
[XmlRoot(ElementName = "FareRuleKey")]
public class FareRuleKey
{
[XmlAttribute(AttributeName = "FareInfoRef")]
public string FareInfoRef { get; set; }
[XmlAttribute(AttributeName = "ProviderCode")]
public string ProviderCode { get; set; }
[XmlText]
public string Text { get; set; }
}
[XmlRoot(ElementName = "FareInfo")]
public class FareInfo
{
[XmlElement(ElementName = "BaggageAllowance")]
public BaggageAllowance BaggageAllowance { get; set; }
[XmlElement(ElementName = "FareRuleKey")]
public FareRuleKey FareRuleKey { get; set; }
[XmlAttribute(AttributeName = "Key")]
public string Key { get; set; }
[XmlAttribute(AttributeName = "FareBasis")]
public string FareBasis { get; set; }
[XmlAttribute(AttributeName = "PassengerTypeCode")]
public string PassengerTypeCode { get; set; }
[XmlAttribute(AttributeName = "Origin")]
public string Origin { get; set; }
[XmlAttribute(AttributeName = "Destination")]
public string Destination { get; set; }
[XmlAttribute(AttributeName = "EffectiveDate")]
public string EffectiveDate { get; set; }
[XmlAttribute(AttributeName = "DepartureDate")]
public string DepartureDate { get; set; }
[XmlAttribute(AttributeName = "Amount")]
public string Amount { get; set; }
[XmlAttribute(AttributeName = "NegotiatedFare")]
public string NegotiatedFare { get; set; }
[XmlAttribute(AttributeName = "PrivateFare")]
public string PrivateFare { get; set; }
[XmlAttribute(AttributeName = "NotValidBefore")]
public string NotValidBefore { get; set; }
[XmlAttribute(AttributeName = "NotValidAfter")]
public string NotValidAfter { get; set; }
[XmlAttribute(AttributeName = "PseudoCityCode")]
public string PseudoCityCode { get; set; }
}
[XmlRoot(ElementName = "FareInfoList")]
public class FareInfoList
{
[XmlElement(ElementName = "FareInfo")]
public List<FareInfo> FareInfo { get; set; }
}
[XmlRoot(ElementName = "Leg")]
public class Leg
{
[XmlAttribute(AttributeName = "Key")]
public string Key { get; set; }
[XmlAttribute(AttributeName = "Group")]
public string Group { get; set; }
[XmlAttribute(AttributeName = "Origin")]
public string Origin { get; set; }
[XmlAttribute(AttributeName = "Destination")]
public string Destination { get; set; }
}
[XmlRoot(ElementName = "Route")]
public class Route
{
[XmlElement(ElementName = "Leg")]
public Leg Leg { get; set; }
[XmlAttribute(AttributeName = "Key")]
public string Key { get; set; }
}
[XmlRoot(ElementName = "RouteList")]
public class RouteList
{
[XmlElement(ElementName = "Route")]
public Route Route { get; set; }
}
[XmlRoot(ElementName = "AirSegmentRef")]
public class AirSegmentRef
{
[XmlAttribute(AttributeName = "Key")]
public string Key { get; set; }
}
[XmlRoot(ElementName = "Journey")]
public class Journey
{
[XmlElement(ElementName = "AirSegmentRef")]
public AirSegmentRef AirSegmentRef { get; set; }
[XmlAttribute(AttributeName = "TravelTime")]
public string TravelTime { get; set; }
}
[XmlRoot(ElementName = "LegRef")]
public class LegRef
{
[XmlAttribute(AttributeName = "Key")]
public string Key { get; set; }
}
[XmlRoot(ElementName = "FareInfoRef")]
public class FareInfoRef
{
[XmlAttribute(AttributeName = "Key")]
public string Key { get; set; }
}
[XmlRoot(ElementName = "BookingInfo")]
public class BookingInfo
{
[XmlAttribute(AttributeName = "BookingCode")]
public string BookingCode { get; set; }
[XmlAttribute(AttributeName = "CabinClass")]
public string CabinClass { get; set; }
[XmlAttribute(AttributeName = "FareInfoRef")]
public string FareInfoRef { get; set; }
[XmlAttribute(AttributeName = "SegmentRef")]
public string SegmentRef { get; set; }
}
[XmlRoot(ElementName = "TaxInfo")]
public class TaxInfo
{
[XmlAttribute(AttributeName = "Category")]
public string Category { get; set; }
[XmlAttribute(AttributeName = "Amount")]
public string Amount { get; set; }
}
[XmlRoot(ElementName = "PassengerType")]
public class PassengerType
{
[XmlAttribute(AttributeName = "Code")]
public string Code { get; set; }
[XmlAttribute(AttributeName = "Age")]
public string Age { get; set; }
}
[XmlRoot(ElementName = "ChangePenalty")]
public class ChangePenalty
{
[XmlElement(ElementName = "Amount")]
public string Amount { get; set; }
}
[XmlRoot(ElementName = "AirPricingInfo")]
public class AirPricingInfo
{
[XmlElement(ElementName = "FareInfoRef")]
public FareInfoRef FareInfoRef { get; set; }
[XmlElement(ElementName = "BookingInfo")]
public BookingInfo BookingInfo { get; set; }
[XmlElement(ElementName = "TaxInfo")]
public List<TaxInfo> TaxInfo { get; set; }
[XmlElement(ElementName = "FareCalc")]
public string FareCalc { get; set; }
[XmlElement(ElementName = "PassengerType")]
public PassengerType PassengerType { get; set; }
[XmlElement(ElementName = "ChangePenalty")]
public ChangePenalty ChangePenalty { get; set; }
[XmlAttribute(AttributeName = "Key")]
public string Key { get; set; }
[XmlAttribute(AttributeName = "TotalPrice")]
public string TotalPrice { get; set; }
[XmlAttribute(AttributeName = "BasePrice")]
public string BasePrice { get; set; }
[XmlAttribute(AttributeName = "ApproximateTotalPrice")]
public string ApproximateTotalPrice { get; set; }
[XmlAttribute(AttributeName = "ApproximateBasePrice")]
public string ApproximateBasePrice { get; set; }
[XmlAttribute(AttributeName = "Taxes")]
public string Taxes { get; set; }
[XmlAttribute(AttributeName = "ApproximateTaxes")]
public string ApproximateTaxes { get; set; }
[XmlAttribute(AttributeName = "LatestTicketingTime")]
public string LatestTicketingTime { get; set; }
[XmlAttribute(AttributeName = "PricingMethod")]
public string PricingMethod { get; set; }
[XmlAttribute(AttributeName = "ETicketability")]
public string ETicketability { get; set; }
[XmlAttribute(AttributeName = "PlatingCarrier")]
public string PlatingCarrier { get; set; }
[XmlAttribute(AttributeName = "ProviderCode")]
public string ProviderCode { get; set; }
}
[XmlRoot(ElementName = "AirPricingSolution")]
public class AirPricingSolution
{
[XmlElement(ElementName = "Journey")]
public Journey Journey { get; set; }
[XmlElement(ElementName = "LegRef")]
public LegRef LegRef { get; set; }
[XmlElement(ElementName = "AirPricingInfo")]
public AirPricingInfo AirPricingInfo { get; set; }
[XmlAttribute(AttributeName = "Key")]
public string Key { get; set; }
[XmlAttribute(AttributeName = "TotalPrice")]
public string TotalPrice { get; set; }
[XmlAttribute(AttributeName = "BasePrice")]
public string BasePrice { get; set; }
[XmlAttribute(AttributeName = "ApproximateTotalPrice")]
public string ApproximateTotalPrice { get; set; }
[XmlAttribute(AttributeName = "ApproximateBasePrice")]
public string ApproximateBasePrice { get; set; }
[XmlAttribute(AttributeName = "Taxes")]
public string Taxes { get; set; }
[XmlAttribute(AttributeName = "ApproximateTaxes")]
public string ApproximateTaxes { get; set; }
}
[XmlRoot(ElementName = "LowFareSearchRsp")]
public class LowFareSearchRsp
{
[XmlElement(ElementName = "FlightDetailsList")]
public FlightDetailsList FlightDetailsList { get; set; }
[XmlElement(ElementName = "AirSegmentList")]
public AirSegmentList AirSegmentList { get; set; }
[XmlElement(ElementName = "FareInfoList")]
public FareInfoList FareInfoList { get; set; }
[XmlElement(ElementName = "RouteList")]
public RouteList RouteList { get; set; }
[XmlElement(ElementName = "AirPricingSolution")]
public List<AirPricingSolution> AirPricingSolution { get; set; }
[XmlAttribute(AttributeName = "TransactionId")]
public string TransactionId { get; set; }
[XmlAttribute(AttributeName = "ResponseTime")]
public string ResponseTime { get; set; }
[XmlAttribute(AttributeName = "DistanceUnits")]
public string DistanceUnits { get; set; }
[XmlAttribute(AttributeName = "CurrencyType")]
public string CurrencyType { get; set; }
[XmlAttribute(AttributeName = "air", Namespace = "http://www.w3.org/2000/xmlns/")]
public string Air { get; set; }
}
}
这是 XML:
<LowFareSearchRsp TransactionId="2D7A0AD80A07643BB75C03CA78C9877F" ResponseTime="2378" DistanceUnits="MI" CurrencyType="EUR" xmlns:air="http://www.travelport.com/schema/air_v28_0"><FlightDetailsList><FlightDetails Key="Q0tqCkHxQfqBJpSbN+LtXQ==" Origin="AMS" Destination="LHR" DepartureTime="2016-03-01T08:35:00.000+01:00" ArrivalTime="2016-03-01T09:00:00.000+00:00" FlightTime="85" TravelTime="85" Equipment="737" DestinationTerminal="4" /><FlightDetails Key="w1vkvs2sQayOxIHugEe06Q==" Origin="AMS" Destination="LCY" DepartureTime="2016-03-01T08:45:00.000+01:00" ArrivalTime="2016-03-01T09:00:00.000+00:00" FlightTime="75" TravelTime="75" Equipment="AR8" /><FlightDetails Key="F5zR9xf/TEe8sjwHe0Lgfg==" Origin="AMS" Destination="LCY" DepartureTime="2016-03-01T08:00:00.000+01:00" ArrivalTime="2016-03-01T08:10:00.000+00:00" FlightTime="70" TravelTime="70" Equipment="AR8" /></FlightDetailsList><AirSegmentList><AirSegment Key="0uT0Eex8R+q0AGhindSZJw==" Group="0" Carrier="KL" FlightNumber="1007" Origin="AMS" Destination="LHR" DepartureTime="2016-03-01T08:35:00.000+01:00" ArrivalTime="2016-03-01T09:00:00.000+00:00" FlightTime="85" Distance="211" ETicketability="Yes" Equipment="737" ChangeOfPlane="false" ParticipantLevel="Secure Sell" LinkAvailability="true" PolledAvailabilityOption="Polled avail used" OptionalServicesIndicator="false" AvailabilitySource="S" AvailabilityDisplayType="Fare Shop/Optimal Shop"><AirAvailInfo ProviderCode="1G"><BookingCodeInfo BookingCounts="J5|C4|D3|I3|Z2|Y9|B9|M9|U9|K9|W9|H0|S9|L0|A0|Q0|T0|E0|N0|R0|V0|X0|G0" /></AirAvailInfo><FlightDetailsRef Key="Q0tqCkHxQfqBJpSbN+LtXQ==" /></AirSegment><AirSegment Key="Xou2ll85S+qgxInLw5cppA==" Group="0" Carrier="KL" FlightNumber="2404" Origin="AMS" Destination="LCY" DepartureTime="2016-03-01T08:45:00.000+01:00" ArrivalTime="2016-03-01T09:00:00.000+00:00" FlightTime="75" Distance="211" ETicketability="Yes" Equipment="AR8" ChangeOfPlane="false" ParticipantLevel="Secure Sell" LinkAvailability="true" PolledAvailabilityOption="Polled avail used" OptionalServicesIndicator="false" AvailabilitySource="S" AvailabilityDisplayType="Fare Shop/Optimal Shop"><CodeshareInfo OperatingCarrier="WX" OperatingFlightNumber="184">CITY JET</CodeshareInfo><AirAvailInfo ProviderCode="1G"><BookingCodeInfo BookingCounts="J9|C9|D9|I9|Z9|Y9|B9|M9|U9|K9|W9|H9|S9|L6|A9|Q9|T6|E0|N0|R0|V0|G0" /></AirAvailInfo><FlightDetailsRef Key="w1vkvs2sQayOxIHugEe06Q==" /></AirSegment><AirSegment Key="1w6HTv96SXWWuLY0Pe2QuQ==" Group="0" Carrier="KL" FlightNumber="2402" Origin="AMS" Destination="LCY" DepartureTime="2016-03-01T08:00:00.000+01:00" ArrivalTime="2016-03-01T08:10:00.000+00:00" FlightTime="70" Distance="211" ETicketability="Yes" Equipment="AR8" ChangeOfPlane="false" ParticipantLevel="Secure Sell" LinkAvailability="true" PolledAvailabilityOption="Polled avail used" OptionalServicesIndicator="false" AvailabilitySource="S" AvailabilityDisplayType="Fare Shop/Optimal Shop"><CodeshareInfo OperatingCarrier="WX" OperatingFlightNumber="182">CITY JET</CodeshareInfo><AirAvailInfo ProviderCode="1G"><BookingCodeInfo BookingCounts="J9|C9|D9|I9|Z9|Y9|B9|M9|U9|K9|W9|H9|S9|L6|A9|Q9|T6|E0|N0|R0|V0|G0" /></AirAvailInfo><FlightDetailsRef Key="F5zR9xf/TEe8sjwHe0Lgfg==" /></AirSegment></AirSegmentList><FareInfoList><FareInfo Key="/2JzpaPgR4GHLl4HEnIiZg==" FareBasis="KBAGYNL" PassengerTypeCode="ADT" Origin="AMS" Destination="LHR" EffectiveDate="2016-02-29T15:41:00.000+01:00" DepartureDate="2016-03-01" Amount="EUR133.00" NegotiatedFare="false" PrivateFare="AirlinePrivateFare" NotValidBefore="2016-03-01" NotValidAfter="2016-03-01" PseudoCityCode="7LD2"><BaggageAllowance><NumberOfPieces>1</NumberOfPieces><MaxWeight /></BaggageAllowance><FareRuleKey FareInfoRef="/2JzpaPgR4GHLl4HEnIiZg==" ProviderCode="1G">6UUVoSldxwglWqQxEnyq/cbKj3F8T9EyxsqPcXxP0TIjSPOlaHfQe9/ilBar8RBLwtrZnoOgR1cYHR4az4coGwd2gmBPo1O6ASmIQpER2x0wNY5k1+MQrLCjWzPlFL6jYBR1VjXHCoG1PqzaFGsJo/E8Wy+Z6VUptu1Q7ZKxyGrtZySrXDhOpdi8VZ+tr8Yjcw61JCjZInRzWhUTy56VK0Y+V0ELMq+/Sutrg11uaZNEQ+ZLml8hMrbyQOwi+ESbfUKpUJwmWYGbGOyXec3aXsoJsodpwGFHJHXyDAS6XXKrSeiEQqx4y86wIJ070sjSq2Mkfg7v2+hW8vSBNa8ZUuJYtF79PC3YsxYLUKGiXKW7eP3a4bhHZA0g8fgZiGj0Vesixah9noHg2BMJ0qOmdc4YTCgtCVCcN49GIwD0nwinN0QJSoeu5/wBShF29N4Sv4Xvb2u1Qx+/he9va7VDH7+F729rtUMfv4Xvb2u1Qx8Qxibp/OJehpo2LrM59tO1jp8ZENljzx72lVAJ3nO/P4n+Mxf03TJScktxA0VgKcbS+gYtjsYoLmbFZUBdXZs1</FareRuleKey></FareInfo><FareInfo Key="vOp7x5iCTnaOfEJmIceWdQ==" FareBasis="HBAGYNL" PassengerTypeCode="ADT" Origin="AMS" Destination="LCY" EffectiveDate="2016-02-29T15:41:00.000+01:00" DepartureDate="2016-03-01" Amount="EUR294.00" NegotiatedFare="false" PrivateFare="AirlinePrivateFare" NotValidBefore="2016-03-01" NotValidAfter="2016-03-01" PseudoCityCode="7LD2"><BaggageAllowance><NumberOfPieces>1</NumberOfPieces><MaxWeight /></BaggageAllowance><FareRuleKey FareInfoRef="vOp7x5iCTnaOfEJmIceWdQ==" ProviderCode="1G">6UUVoSldxwglWqQxEnyq/cbKj3F8T9EyxsqPcXxP0TIjSPOlaHfQe/r7UOc8hVd+I/+NqP0rKzLusgtyd1y6qgP9G0W6IHlhpqZ6lb6AP0xNjTzzGmA6/Urra4NdbmmTzFOd+W7w/UzJ2lQug+wKWM3BdGL2xyFSNsm3fw/kMAOxMmAX3SbpGDy3fBfc+mJVEPaEs+237t0eSBuiOpSk/gzsLeFdZfeBzi5JKGVGwBPPOvXkrT+ckAxdqLsZnUAM83fZ3yCAPapY9YklFLj9Z/MCXrZl6G/oVCulqMwbpNbfH3zc0NhSMKqdj8Ih8qyqVnAnvWMa00Sdw/Am9T/DRMsiOHFaFMf8GWXoXHIgLpyVqfCTByZWB+lREtwo3mkOzK0Iy0HMiGbqNbjwzJx7oqPv19h9EZpQEQ4DmK2C6uFH/+bkQTnfvoq+cJFUBzrily5qxZ3qLwOXLmrFneovA5cuasWd6i8Dly5qxZ3qLwOXLmrFneovA3N5jV9Rrzq8txHW6jzw2UbAQJCzzE4cyQuLI8q+Wie1FwDp7I8hPtiGaLihfOSYJ8Bo4QYxmFzt</FareRuleKey></FareInfo></FareInfoList><RouteList><Route Key="rX1yXg7iR4+opM4/Ol7rrw=="><Leg Key="NYqOScjGQESvuXuIGUjFqg==" Group="0" Origin="AMS" Destination="LON" /></Route></RouteList><AirPricingSolution Key="uIwAvUxtTuK4hqFLGAnJaQ==" TotalPrice="EUR160.05" BasePrice="EUR133.00" ApproximateTotalPrice="EUR160.05" ApproximateBasePrice="EUR133.00" Taxes="EUR27.05" ApproximateTaxes="EUR27.05"><Journey TravelTime="P0DT1H25M0S"><AirSegmentRef Key="0uT0Eex8R+q0AGhindSZJw==" /></Journey><LegRef Key="NYqOScjGQESvuXuIGUjFqg==" /><AirPricingInfo Key="8DDuD5q9TTWmR6+Y1QIPuQ==" TotalPrice="EUR160.05" BasePrice="EUR133.00" ApproximateTotalPrice="EUR160.05" ApproximateBasePrice="EUR133.00" Taxes="EUR27.05" ApproximateTaxes="EUR27.05" LatestTicketingTime="2016-03-01T23:59:00.000+01:00" PricingMethod="GuaranteedUsingAirlinePrivateFare" ETicketability="Yes" PlatingCarrier="KL" ProviderCode="1G"><FareInfoRef Key="/2JzpaPgR4GHLl4HEnIiZg==" /><BookingInfo BookingCode="K" CabinClass="Economy" FareInfoRef="/2JzpaPgR4GHLl4HEnIiZg==" SegmentRef="0uT0Eex8R+q0AGhindSZJw==" /><TaxInfo Category="CJ" Amount="EUR12.17" /><TaxInfo Category="RN" Amount="EUR14.38" /><TaxInfo Category="VV" Amount="EUR0.50" /><FareCalc>AMS KL LON 144.81KBAGYNL NUC144.81END ROE0.918404</FareCalc><PassengerType Code="ADT" Age="20" /><ChangePenalty><Amount>EUR70.00</Amount></ChangePenalty></AirPricingInfo></AirPricingSolution><AirPricingSolution Key="4Og1WgNSQf6r7WHXpetyqA==" TotalPrice="EUR321.05" BasePrice="EUR294.00" ApproximateTotalPrice="EUR321.05" ApproximateBasePrice="EUR294.00" Taxes="EUR27.05" ApproximateTaxes="EUR27.05"><Journey TravelTime="P0DT1H15M0S"><AirSegmentRef Key="Xou2ll85S+qgxInLw5cppA==" /></Journey><LegRef Key="NYqOScjGQESvuXuIGUjFqg==" /><AirPricingInfo Key="hauIf2TLRE+xSFkaJa1bAQ==" TotalPrice="EUR321.05" BasePrice="EUR294.00" ApproximateTotalPrice="EUR321.05" ApproximateBasePrice="EUR294.00" Taxes="EUR27.05" ApproximateTaxes="EUR27.05" LatestTicketingTime="2016-03-01T23:59:00.000+01:00" PricingMethod="GuaranteedUsingAirlinePrivateFare" ETicketability="Yes" PlatingCarrier="KL" ProviderCode="1G"><FareInfoRef Key="vOp7x5iCTnaOfEJmIceWdQ==" /><BookingInfo BookingCode="H" CabinClass="Economy" FareInfoRef="vOp7x5iCTnaOfEJmIceWdQ==" SegmentRef="Xou2ll85S+qgxInLw5cppA==" /><TaxInfo Category="CJ" Amount="EUR12.17" /><TaxInfo Category="RN" Amount="EUR14.38" /><TaxInfo Category="VV" Amount="EUR0.50" /><FareCalc>AMS KL LON 320.12HBAGYNL NUC320.12END ROE0.918404</FareCalc><PassengerType Code="ADT" Age="20" /><ChangePenalty><Amount>EUR70.00</Amount></ChangePenalty></AirPricingInfo></AirPricingSolution><AirPricingSolution Key="VD1GnxpWQJi/4emcBGZTKQ==" TotalPrice="EUR321.05" BasePrice="EUR294.00" ApproximateTotalPrice="EUR321.05" ApproximateBasePrice="EUR294.00" Taxes="EUR27.05" ApproximateTaxes="EUR27.05"><Journey TravelTime="P0DT1H10M0S"><AirSegmentRef Key="1w6HTv96SXWWuLY0Pe2QuQ==" /></Journey><LegRef Key="NYqOScjGQESvuXuIGUjFqg==" /><AirPricingInfo Key="OvfECYiLRraifkOqyl1qGA==" TotalPrice="EUR321.05" BasePrice="EUR294.00" ApproximateTotalPrice="EUR321.05" ApproximateBasePrice="EUR294.00" Taxes="EUR27.05" ApproximateTaxes="EUR27.05" LatestTicketingTime="2016-03-01T23:59:00.000+01:00" PricingMethod="GuaranteedUsingAirlinePrivateFare" ETicketability="Yes" PlatingCarrier="KL" ProviderCode="1G"><FareInfoRef Key="vOp7x5iCTnaOfEJmIceWdQ==" /><BookingInfo BookingCode="H" CabinClass="Economy" FareInfoRef="vOp7x5iCTnaOfEJmIceWdQ==" SegmentRef="1w6HTv96SXWWuLY0Pe2QuQ==" /><TaxInfo Category="CJ" Amount="EUR12.17" /><TaxInfo Category="RN" Amount="EUR14.38" /><TaxInfo Category="VV" Amount="EUR0.50" /><FareCalc>AMS KL LON 320.12HBAGYNL NUC320.12END ROE0.918404</FareCalc><PassengerType Code="ADT" Age="20" /><ChangePenalty><Amount>EUR70.00</Amount></ChangePenalty></AirPricingInfo></AirPricingSolution></LowFareSearchRsp>
我坚持下去了。请帮忙。
最佳答案
在对您的代码进行少量修改后,它对我来说工作正常:
XmlSerializer serialize = new XmlSerializer(typeof(UnitTestProject.LowFareSearchRsp));
StringReader rdr = new StringReader(xml);
LowFareSearchRsp res = (LowFareSearchRsp)serialize.Deserialize(rdr);
很快,您的资源类型有误:LowFareSearchCorpRsp
而不是 LowFareSearchRsp
关于c# - 使用 XmlSerializer 解析 xml 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35703987/
我在网上搜索但没有找到任何合适的文章解释如何使用 javascript 使用 WCF 服务,尤其是 WebScriptEndpoint。 任何人都可以对此给出任何指导吗? 谢谢 最佳答案 这是一篇关于
我正在编写一个将运行 Linux 命令的 C 程序,例如: cat/etc/passwd | grep 列表 |剪切-c 1-5 我没有任何结果 *这里 parent 等待第一个 child (chi
所以我正在尝试处理文件上传,然后将该文件作为二进制文件存储到数据库中。在我存储它之后,我尝试在给定的 URL 上提供文件。我似乎找不到适合这里的方法。我需要使用数据库,因为我使用 Google 应用引
我正在尝试制作一个宏,将下面的公式添加到单元格中,然后将其拖到整个列中并在 H 列中复制相同的公式 我想在 F 和 H 列中输入公式的数据 Range("F1").formula = "=IF(ISE
问题类似于this one ,但我想使用 OperatorPrecedenceParser 解析带有函数应用程序的表达式在 FParsec . 这是我的 AST: type Expression =
我想通过使用 sequelize 和 node.js 将这个查询更改为代码取决于在哪里 select COUNT(gender) as genderCount from customers where
我正在使用GNU bash,版本5.0.3(1)-发行版(x86_64-pc-linux-gnu),我想知道为什么简单的赋值语句会出现语法错误: #/bin/bash var1=/tmp
这里,为什么我的代码在 IE 中不起作用。我的代码适用于所有浏览器。没有问题。但是当我在 IE 上运行我的项目时,它发现错误。 而且我的 jquery 类和 insertadjacentHTMl 也不
我正在尝试更改标签的innerHTML。我无权访问该表单,因此无法编辑 HTML。标签具有的唯一标识符是“for”属性。 这是输入和标签的结构:
我有一个页面,我可以在其中返回用户帖子,可以使用一些 jquery 代码对这些帖子进行即时评论,在发布新评论后,我在帖子下插入新评论以及删除 按钮。问题是 Delete 按钮在新插入的元素上不起作用,
我有一个大约有 20 列的“管道分隔”文件。我只想使用 sha1sum 散列第一列,它是一个数字,如帐号,并按原样返回其余列。 使用 awk 或 sed 执行此操作的最佳方法是什么? Accounti
我需要将以下内容插入到我的表中...我的用户表有五列 id、用户名、密码、名称、条目。 (我还没有提交任何东西到条目中,我稍后会使用 php 来做)但由于某种原因我不断收到这个错误:#1054 - U
所以我试图有一个输入字段,我可以在其中输入任何字符,但然后将输入的值小写,删除任何非字母数字字符,留下“。”而不是空格。 例如,如果我输入: 地球的 70% 是水,-!*#$^^ & 30% 土地 输
我正在尝试做一些我认为非常简单的事情,但出于某种原因我没有得到想要的结果?我是 javascript 的新手,但对 java 有经验,所以我相信我没有使用某种正确的规则。 这是一个获取输入值、检查选择
我想使用 angularjs 从 mysql 数据库加载数据。 这就是应用程序的工作原理;用户登录,他们的用户名存储在 cookie 中。该用户名显示在主页上 我想获取这个值并通过 angularjs
我正在使用 autoLayout,我想在 UITableViewCell 上放置一个 UIlabel,它应该始终位于单元格的右侧和右侧的中心。 这就是我想要实现的目标 所以在这里你可以看到我正在谈论的
我需要与 MySql 等效的 elasticsearch 查询。我的 sql 查询: SELECT DISTINCT t.product_id AS id FROM tbl_sup_price t
我正在实现代码以使用 JSON。 func setup() { if let flickrURL = NSURL(string: "https://api.flickr.com/
我尝试使用for循环声明变量,然后测试cols和rols是否相同。如果是,它将运行递归函数。但是,我在 javascript 中执行 do 时遇到问题。有人可以帮忙吗? 现在,在比较 col.1 和
我举了一个我正在处理的问题的简短示例。 HTML代码: 1 2 3 CSS 代码: .BB a:hover{ color: #000; } .BB > li:after {
我是一名优秀的程序员,十分优秀!