'Error serializing body'. Problem calling Fedex webservice through .NET 3.5

Posted by Simon_Weaver on Stack Overflow See other posts from Stack Overflow or by Simon_Weaver
Published on 2008-12-05T22:37:39Z Indexed on 2010/04/27 7:23 UTC
Read the original article Hit count: 334

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about web-services

Related posts about .NET