示例代码上的System.InvalidOperationException

时间:2014-03-07 17:37:40

标签: vb.net web service wsdl

我正在使用FedEx.com提供给我的一些现有示例代码来跟踪包裹。但是,我无法让它为我的生活而工作。有谁知道以下意思:

System.InvalidOperationException was unhandled
  Message="Unable to generate a temporary class (result=1). error CS0029: Cannot implicitly convert 
           type 'AddressValidationWebServiceClient.AddressValidationWebReference.ParsedElement' 
           to 'AddressValidationWebServiceClient.AddressValidationWebReference.ParsedElement[]' "
  Source="System.Xml"
  StackTrace:
       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 AddressValidationWebServiceClient.AddressValidationWebReference.AddressValidationService..ctor() in C:\Documents and Settings\jessey\My Documents\Visual Studio 2008\Projects\AddressValidationWebServiceClient\Web References\AddressValidationWebReference\Reference.vb:line 40    
       at AddressValidationWebServiceClient.AddressValidationWebServiceClient.Main() in C:\Documents and Settings\jessey\My Documents\Visual Studio 2008\Projects\AddressValidationWebServiceClient\AddressValidationWebServiceClient.vb:line 28    
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)    
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)    
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()    
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)    
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)    
       at System.Threading.ThreadHelper.ThreadStart()

令人讨厌的代码行是:

Dim service As AddressValidationService = New AddressValidationService()

0 个答案:

没有答案