FedEx Integration Address Service: Unable to generate a temporary class…ParsedElement[]

Are you using the new WCF service reference against the FedEx Address service WSDL? I’ll bet your scratching your head on why you get this craptastic error.

 InnerException: {"Unable to generate a temporary class (result=1).rnerror CS0030: Cannot convert type 'YOURNAMESPACE.FedExAddressService.ParsedElement[]' to 'YOURNAMESPACE.FedExAddressService.ParsedElement'rnerror CS0029: Cannot implicitly convert type 'YOURNAMESPACE.FedExAddressService.ParsedElement' to 'YOURNAMESPACE.FedExAddressService.ParsedElement[]'rn"}
    Message: "There was an error in serializing body of message addressValidationRequest1: 'Unable to generate a temporary class (result=1).rnerror CS0030: Cannot convert type 'YOURNAMESPACE.FedExAddressService.ParsedElement[]' to 'YOURNAMESPACE.FedExAddressService.ParsedElement'rnerror CS0029: Cannot implicitly convert type 'YOURNAMESPACE.FedExAddressService.ParsedElement' to 'YOURNAMESPACE.FedExAddressService.ParsedElement[]'rn'.  Please see InnerException for more details."
    Source: "mscorlib"

The answer is annoying. You would think running on the .NET 4.0 Framework they would have figured out their bugs with consuming WSDL’s.

So, open your references.cs file for the service. (It’s hidden, you either go to disk or hit the little icon that says show all files, hit the arrow on the service reference, then you see the magic file)

Hit Ctrl+H and type in [][] for the find and replace with [].

Basically, it made this nice two dimensional array that the server is less than pleased to receive.

If you refresh from the WSDL, guess what? You get to do this all over again, so quit hitting the refresh button.

Happy coding!

0 Replies to “FedEx Integration Address Service: Unable to generate a temporary class…ParsedElement[]”

  1. i had the same problem .but inside my website program i didnt find any reference.cs file.

    i saw the reference.cs file in fedex address console application .so please help me to solve the above error

  2. Reference.cs is for a C# site or app.
    Reference.vb in a site or app developed in VB.NET. For VB.NET you need to search for ()() rather than [][].

    You will have to do this every time you import the web reference; say for instance you add the reference to a new project, even if you import from a wdsl file you have already fixed.

Leave a Reply

Your email address will not be published. Required fields are marked *