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

后端 未结 3 1584
日久生厌
日久生厌 2020-12-16 20:52

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 a

3条回答
  •  孤街浪徒
    2020-12-16 21:46

    Turns out Fedex's own documentation covers this specifically!

    I am using wsdl.exe from Microsoft to generate code and I get an error CS0029: Cannot implicitly convert type 'fedexreq.ParsedElement' to 'fedexreq.ParsedElement[]'.

    This is an error generated by Web Services Description Language Tool (Wsdl.exe) to generate the client information. When you publish a schema that contains nested nodes that have the maxOccurs attribute set to the "unbounded" value, the Wsdl.exe tool creates multidimensional arrays in the generated code file. Therefore, the generated code contains incorrect types for the nested nodes. To solve modify the generated code by removing the bracket ([]) array characters from the data type delectation statements. For more information see http://support.microsoft.com/kb/326790/en-us and http://support.microsoft.com/kb/891386

提交回复
热议问题