尝试通过VB使用TravelItineraryReadService 3.8.0服务时,只需执行以下操作即可获得以下错误
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添加为
如果我添加标题信息并不重要。它总是失败。
答案 0 :(得分:1)
这是由于生成的Web服务代理类中的响应对象问题。 改变了以下内容,对我来说效果很好。
1。 Private associatedDataField()()As TravelItineraryReadRSTravelItineraryItineraryInfoItineraryPricingPriceQuoteMiscInformationTicketingFeesFeeInformationAssociatedDataAssociatedDataItem
----更改如下 - Private associatedDataField()As
TravelItineraryReadRSTravelItineraryItineraryInfoItineraryPricingPriceQuoteMiscInformationTicketingFeesFeeInformationAssociatedDataAssociatedDataItem
----改变如下 -
Public Property AssociatedData()As TravelItineraryReadRSTravelItineraryItineraryInfoItineraryPricingPriceQuoteMiscInformationTicketingFeesFeeInformationAssociatedDataAssociatedDataItem()