Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Web service unable to generate a temporary class

I'm trying to instantiate a web service in my .NET web application. But as soon as it hits this line:

registerService register = new registerService();

Then i get the following error:

Unable to generate a temporary class (result=1). error CS0030: Cannot convert type 'Test.Website.ProxyTest.registerType[]' to 'Test.Website.ProxyTest.registerType'

I didn't write the web service. But does this mean the web service has an error somewhere (in an XSD or something)?

Does this mean that the 3rd party developers need to fix this web service?

like image 259
Vivendi Avatar asked Mar 20 '13 11:03

Vivendi


1 Answers

It seems to be a Known issue and the details can be found here

Cause: A known issue with WSDL.EXE included in the .NET Framework can cause a proxy class to be generated incorrectly if an array of complex type includes an element that is also an array of complex type for which only one element exists

.

There is no resolution available at this time however there are three available workarounds:

Generate the proxy class manually using WSDL.EXE and then modify the proxy class where the datatype has been inappropriately created as a two-dimensional array (e.g. 'CustomType[][]') and correct it to be a single-dimensional array (e.g. 'CustomType[]'). Modify the datatype in the desired WSDL so that a second, optional element is included in the definition. This can be done by adding an element such as ''. Modify the complex type in the desired WSDL so that the boundary attributes are part of the complex type rather than the element (i.e. move the "minOccurs" and "maxOccurs" attributes to the complex type and remove them from the element).

A similar stackoverflow question

like image 122
V4Vendetta Avatar answered Oct 03 '22 14:10

V4Vendetta