我正在使用Fedex的Web服务并且在我真正能够到达任何地方之前预先得到一个恼人的错误.
序列化消息addressValidationRequest1的主体时出错:'无法生成临时类(result = 1).错误CS0030:无法将类型'FedEx.InterOp.AddressValidationServiceReference.ParsedElement []'转换为'FedEx.InterOp.AddressValidationServiceReference.ParsedElement'错误CS0029:无法将类型'FedEx.InterOp.AddressValidationServiceReference.ParsedElement'隐式转换为'FedEx.InterOp.AddressValidationServiceReference .ParsedElement []''.有关更多详细信息,请参阅InnerException.
我正在使用.NET 3.5并为我生成了一个可怕的命名类(我不确定为什么它不仅仅是AddressValidationService):
AddressValidationPortTypeClient addressValidationService = new ...;
在这堂课上,我打电话给我:
addressValidationService.addressValidation(request);
这是我收到此错误的时候.
我能找到这个错误的唯一参考来自古老的1.1项目.在我的情况下,我的DLL引用了System.Web和System.Web.Services,这似乎是一个问题.