0

伙计们,我正在从 webservice api 获得基于 xml 的响应的响应,现在问题是我想在我的页面上将响应显示为简单的 html,但我不知道如何在 c# 中做到这一点。任何帮助将不胜感激。我的响应得到是这样的:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <OTA_AirLowFareSearchRS Version="2.001" xmlns="http://www.opentravel.org/OTA/2003/05">
            <PricedItineraries>
                <PricedItinerary CompositeFlightNumber="S2101" CountCompositeFlightNumber="1" OriginDestinationRPH="0" SequenceNumber="1" SupplierSystem="Amadeus">
                    <AirItinerary SupplierSystem="Amadeus">
                        <OriginDestinationOptions>
                            <OriginDestinationOption Duration="01:55:00" FromCache="true" SupplierSystem="Amadeus">
                                <FlightSegment ArrivalDateTime="2007-11-11T08:55:00" DepartureDateTime="2007-11-11T07:00:00" E_TicketEligibility="Eligible" FlightNumber="101" RPH="1" ResBookDesigCode="O">
                                    <BookingClassAvail RPH="1" ResBookDesigCode="O" ResBookDesigQuantity="4"/>
                                    <DepartureAirport LocationCode="DEL"/>
                                    <ArrivalAirport LocationCode="BOM"/>
                                    <Equipment AirEquipType="737"/>
                                    <MarketingAirline Code="S2"/>
                                </FlightSegment>
       <FormData>
                <FareInformationIDs>
                <FareInformationID BaseFare="1825" Code="" FareCode="UGOSAVE" FareID="0" PTCID="1" Quantity="">0</FareInformationID>
            </FareInformationIDs>
      </FormData>                            
</OriginDestinationOption>
                        </OriginDestinationOptions>
                    </AirItinerary>
                    <AirItineraryPricingInfo>
                        <ItinTotalFare>
                            <BaseFare Amount="1875" CurrencyCode="INR"/>
                            <Taxes>
                                <Tax Amount="1575" CurrencyCode="INR" TaxCode="TTL"/>
                            </Taxes>
                            <TotalFare Amount="3461.63" CurrencyCode="INR"/>
                            <ServiceTax Amount="11.63" Currency="INR" Description="Service Tax" ServiceTaxCode="ST" ServiceTaxRate="0.0062"/>
                        </ItinTotalFare>
                        <PTC_FareBreakdowns>
                            <PTC_FareBreakdown>
                                <PassengerTypeQuantity Code="ADT" Quantity="1"/>
                                <FareBasisCodes>
                                    <FareBasisCode>OSASAS</FareBasisCode>
                                </FareBasisCodes>
                                <PassengerFare>
                                    <BaseFare Amount="1875" CurrencyCode="INR"/>
                                    <Taxes>
                                        <Tax Amount="1575" CurrencyCode="INR" TaxCode="TTL"/>
                                    </Taxes>
                                    <TotalFare Amount="3450" CurrencyCode="INR"/>
                                </PassengerFare>
                            </PTC_FareBreakdown>
                        </PTC_FareBreakdowns>
                        <FareInfos>
                            <FareInfo>
                                <FareReference>OSASAS</FareReference>
                                <FilingAirline Code="ZZ"/>
                                <DepartureAirport LocationCode="DEL"/>
                                <ArrivalAirport LocationCode="BOM"/>
                            </FareInfo>
                        </FareInfos>
                    </AirItineraryPricingInfo>
                    <TicketingInfo DeliveryMethod="EMAIL" TicketTimeLimit="" TicketType="eTicket" TicketingStatus="" eTicketNumber="">
                        <TicketAdvisory Language="English"/>
                    </TicketingInfo>
                </PricedItinerary>
            </PricedItineraries>
        </OTA_AirLowFareSearchRS>
    </soapenv:Body>
</soapenv:Envelope> 
4

1 回答 1

0

您可以使用 XSLT 转换 xml

更多信息在这里

于 2013-01-17T08:12:22.173 回答