2016-11-15 89 views
0

當試圖僅僅通過操作的方式從VB我收到以下錯誤使用TravelItineraryReadService 3.8.0服務TravelItineraryReadService VB錯誤

Private service As TravelItineraryReadService  
service = New TravelItineraryReadService 

錯誤輸出:

at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence) 
    at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies) 
    at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence) 
    at System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type) 
    at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type) 
    at System.Web.Services.Protocols.SoapClientType..ctor(Type type) 
    at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor() 
    at PricingContingency.TravelItineraryRQ1.TravelItineraryReadService..ctor() 

我使用的Visual Studio 2015年, 將WSDL添加爲webservice wsdl added

如果我添加標題信息,則無關緊要。它總是失敗。

+0

不應該'TravelItineraryReadService service'是'昏暗的服務爲TravelItineraryReadService'變化? –

+0

更正了代碼 – GriffiN

+0

@ProGrammer通過wsdl發現了generationg的問題。 實例化的服務,我得到以下錯誤時: 錯誤CS0030:無法將類型「TravelItineraryTest.TravelItineraryReadRQ1.TravelItineraryReadRSTravelItineraryItineraryInfoItineraryPricingPriceQuoteMiscInformationTicketingFeesFeeInformationAssociatedDataAssociatedDataItem []」到「TravelItineraryTest.TravelItineraryReadRQ1.TravelItineraryReadRSTravelItineraryItineraryInfoItineraryPricingPriceQuoteMiscInformationTicketingFeesFeeInformationAssociatedDataAssociatedDataItem」 – GriffiN

回答

1

這是由於生成的Web服務代理類中的響應對象問題。 更改了以下內容,適合我。

1. 私人associatedDataField()()作爲TravelItineraryReadRSTravelItineraryItineraryInfoItineraryPricingPriceQuoteMiscInformationTicketingFeesFeeInformationAssociatedDataAssociatedDataItem

----變化below--私人associatedDataField()作爲

TravelItineraryReadRSTravelItineraryItineraryInfoItineraryPricingPriceQuoteMiscInformationTicketingFeesFeeInformationAssociatedDataAssociatedDataItem

  • 公共屬性AssociatedData()作爲Tra velItineraryReadRSTravelItineraryItineraryInfoItineraryPricingPriceQuoteMiscInformationTicketingFeesFeeInformationAssociatedDataAssociatedDataItem()()
  • ----作爲below--

    公共財產AssociatedData()作爲TravelItineraryReadRSTravelItineraryItineraryInfoItineraryPricingPriceQuoteMiscInformationTicketingFeesFeeInformationAssociatedDataAssociatedDataItem()

    +0

    謝謝!發現在另一篇文章的評論。標記爲答案。 – GriffiN