C# 访问WSDL文件的SOAP客户端

C# 访问WSDL文件的SOAP客户端,c#,asp.net,web-services,wsdl,sabre,C#,Asp.net,Web Services,Wsdl,Sabre,我在C#中的ASP.NET中工作,在sabre的webservices中,我尝试调用wwebservice airlowfaresearch,这很好,但我会努力让讨价还价搜索器获得最大备用日期,我使用了以下内容:webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirLowFareSearchLLS1.13.1RQ.wsdl 并更改了:BargainFinderMax_ADRQ的操作,这是我的请求: <?xml version="1.0"

我在C#中的ASP.NET中工作,在sabre的webservices中,我尝试调用wwebservice airlowfaresearch,这很好,但我会努力让讨价还价搜索器获得最大备用日期,我使用了以下内容:
webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirLowFareSearchLLS1.13.1RQ.wsdl
并更改了
:BargainFinderMax_ADRQ
的操作,这是我的请求:

<?xml version="1.0" encoding="UTF-8"?>
<OTA_AirLowFareSearchRQ AltLangID="en-us" PrimaryLangID="en-us" SequenceNmbr="1" Version="3.1.0" Target="Test" TimeStamp="0001-01-01T12:00:00" EchoToken="String" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <POS>
        <Source PseudoCityCode="X0JA"/>
    </POS>
    <OriginDestinationInformation RPH="1">
        <DepartureDateTime>2017-06-07</DepartureDateTime>
        <OriginLocation LocationCode="LIM"/>
        <DestinationLocation LocationCode="AQP"/>
        <TPA_Extensions>
            <SegmentType Code="O"/>
            <WithoutAvail/>
        </TPA_Extensions>
    </OriginDestinationInformation>
    <OriginDestinationInformation RPH="2">
        <DepartureDateTime>2017-06-10</DepartureDateTime>
        <OriginLocation LocationCode="AQP"/>
        <DestinationLocation LocationCode="LIM"/>
        <TPA_Extensions>
            <SegmentType Code="O"/>
            <WithoutAvail/>
        </TPA_Extensions>
    </OriginDestinationInformation>
    <TravelPreferences MaxStopsQuantity="2">
        <CabinPref RPH="1" Code="Y"/>
        <CabinPref RPH="2" Code="Y"/>
        <TPA_Extensions>
            <ExcludeVendorPref Code="2I"/>
            <ExcludeVendorPref Code="UA"/>
            <ExcludeVendorPref Code="IB"/>
            <NumTrips Number="19"/>
        </TPA_Extensions>
    </TravelPreferences>
    <TravelerInformation>
        <PassengerTypeQuantity Code="ADT" Quantity="1"/>
        <TPA_Extensions/>
    </TravelerInformation>
    <PriceRequestInformation CurrencyCode="USD">
        <TPA_Extensions>
            <FareCalc>
                <FareBasis WithFareCalc="true"/>
            </FareCalc>
            <Priority>
                <Price Priority="1"/>
                <DirectFlights Priority="2"/>
                <Time Priority="3"/>
                <Vendor Priority="4"/>
            </Priority>
        </TPA_Extensions>
    </PriceRequestInformation>
    <TPA_Extensions>
        <IntelliSellTransaction>
            <RequestType Name="AD3"/>
        </IntelliSellTransaction>
    </TPA_Extensions>
</OTA_AirLowFareSearchRQ>
我得到这个错误:

对象引用未设置为对象的实例

而xml响应仅限于此:

<?xml version="1.0" encoding="UTF-8"?>
<OTA_AirLowFareSearchRS xsi:nil="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>


此问题的原因是什么?

以下是您的工作BFM_AD请求示例:

<soapenv:Body>
    <OTA_AirLowFareSearchRQ AvailableFlightsOnly="true" ResponseType="OTA" ResponseVersion="3.0.0" Version="3.0.0" xmlns="http://www.opentravel.org/OTA/2003/05">
        <POS>
            <Source PseudoCityCode="***">
                <RequestorID ID="1" Type="1">
                    <CompanyName Code="TN"/>
                </RequestorID>
            </Source>
        </POS>
        <OriginDestinationInformation RPH="1">
            <DepartureDateTime>2017-06-15T00:00:00</DepartureDateTime>
            <DepartureWindow>00002359</DepartureWindow>
            <OriginLocation LocationCode="LIM" LocationType="A"/>
            <DestinationLocation LocationCode="AQP" LocationType="A"/>
            <TPA_Extensions>
                <SegmentType Code="O"/>
            </TPA_Extensions>
        </OriginDestinationInformation>
        <OriginDestinationInformation RPH="2">
            <DepartureDateTime>2017-06-18T00:00:00</DepartureDateTime>
            <DepartureWindow>00002359</DepartureWindow>
            <OriginLocation LocationCode="AQP" LocationType="A"/>
            <DestinationLocation LocationCode="LIM" LocationType="A"/>
            <TPA_Extensions>
                <SegmentType Code="O"/>
            </TPA_Extensions>
        </OriginDestinationInformation>
        <TravelPreferences ETicketDesired="true" ValidInterlineTicket="true">
            <TPA_Extensions>
                <TripType Value="Return"/>
                <FlightStopsAsConnections Ind="true"/>
                <ExcludeCallDirectCarriers Enabled="true"/>
            </TPA_Extensions>
            <Baggage Description="true" RequestType="A"/>
        </TravelPreferences>
        <TravelerInfoSummary>
            <SeatsRequested>1</SeatsRequested>
            <AirTravelerAvail>
                <PassengerTypeQuantity Code="ADT" Quantity="1"/>
            </AirTravelerAvail>
            <PriceRequestInformation CurrencyCode="TRY" NegotiatedFaresOnly="false">
                <TPA_Extensions>
                    <BrandedFareIndicators MultipleBrandedFares="true"/>
                </TPA_Extensions>
            </PriceRequestInformation>
        </TravelerInfoSummary>
        <TPA_Extensions>
            <IntelliSellTransaction>
                <RequestType Name="AD3"/>
            </IntelliSellTransaction>
        </TPA_Extensions>
    </OTA_AirLowFareSearchRQ>
</soapenv:Body>

2017-06-15T00:00:00
00002359
2017-06-18T00:00:00
00002359
1.


我建议您从工作请求开始,在获得成功的响应后,您应该根据需要专门处理该请求。

谢谢您的回答,但我知道这应该是请求,但我希望它以这样的方式出现,但在C中,我不知道如何做,因为我没有放任何回执,请让我清楚,您使用的是.NET wsdl生成的请求模型类,因此无法使用http客户端发出普通的SOAP XML请求,对吗?
<soapenv:Body>
    <OTA_AirLowFareSearchRQ AvailableFlightsOnly="true" ResponseType="OTA" ResponseVersion="3.0.0" Version="3.0.0" xmlns="http://www.opentravel.org/OTA/2003/05">
        <POS>
            <Source PseudoCityCode="***">
                <RequestorID ID="1" Type="1">
                    <CompanyName Code="TN"/>
                </RequestorID>
            </Source>
        </POS>
        <OriginDestinationInformation RPH="1">
            <DepartureDateTime>2017-06-15T00:00:00</DepartureDateTime>
            <DepartureWindow>00002359</DepartureWindow>
            <OriginLocation LocationCode="LIM" LocationType="A"/>
            <DestinationLocation LocationCode="AQP" LocationType="A"/>
            <TPA_Extensions>
                <SegmentType Code="O"/>
            </TPA_Extensions>
        </OriginDestinationInformation>
        <OriginDestinationInformation RPH="2">
            <DepartureDateTime>2017-06-18T00:00:00</DepartureDateTime>
            <DepartureWindow>00002359</DepartureWindow>
            <OriginLocation LocationCode="AQP" LocationType="A"/>
            <DestinationLocation LocationCode="LIM" LocationType="A"/>
            <TPA_Extensions>
                <SegmentType Code="O"/>
            </TPA_Extensions>
        </OriginDestinationInformation>
        <TravelPreferences ETicketDesired="true" ValidInterlineTicket="true">
            <TPA_Extensions>
                <TripType Value="Return"/>
                <FlightStopsAsConnections Ind="true"/>
                <ExcludeCallDirectCarriers Enabled="true"/>
            </TPA_Extensions>
            <Baggage Description="true" RequestType="A"/>
        </TravelPreferences>
        <TravelerInfoSummary>
            <SeatsRequested>1</SeatsRequested>
            <AirTravelerAvail>
                <PassengerTypeQuantity Code="ADT" Quantity="1"/>
            </AirTravelerAvail>
            <PriceRequestInformation CurrencyCode="TRY" NegotiatedFaresOnly="false">
                <TPA_Extensions>
                    <BrandedFareIndicators MultipleBrandedFares="true"/>
                </TPA_Extensions>
            </PriceRequestInformation>
        </TravelerInfoSummary>
        <TPA_Extensions>
            <IntelliSellTransaction>
                <RequestType Name="AD3"/>
            </IntelliSellTransaction>
        </TPA_Extensions>
    </OTA_AirLowFareSearchRQ>
</soapenv:Body>