'Error serializing body'. Problem calling Fedex webservice through .NET 3.5
- by Simon_Weaver
I'm using Fedex's web services and getting an annoying error right up front before I can actually get anywhere.
There was an error in serializing body of message addressValidationRequest1: 'Unable to generate a temporary class (result=1).
error CS0030: Cannot convert type 'FedEx.InterOp.AddressValidationServiceReference.ParsedElement[]' to 'FedEx.InterOp.AddressValidationServiceReference.ParsedElement'
error CS0029: Cannot implicitly convert type 'FedEx.InterOp.AddressValidationServiceReference.ParsedElement' to 'FedEx.InterOp.AddressValidationServiceReference.ParsedElement[]'
'. Please see InnerException for more details.
I'm using .NET 3.5 and get a horrible named class generated for me (I'm not sure why it isn't just AddressValidationService):
AddressValidationPortTypeClient addressValidationService = new ...;
on this class I make my web service call:
addressValidationService.addressValidation(request);
This is when I get this error.
The only references I can find to this error come from ancient 1.1 projects. In my case my DLL has references to System.Web and System.Web.Services which seemed to be an issue back then.