5

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?

Vivendi
  • 20,047
  • 25
  • 121
  • 196
  • 1
    Maybe this might help http://stackoverflow.com/questions/6678934/unable-to-generate-a-temporary-class-result-1-error-cs0030-cannot-convert-ty – V4Vendetta Mar 20 '13 at 11:48
  • @V4Vendetta Thanks, that did help. But i'm still wondering if this is eventually something that should be fixed by the person who created the Web Service. Any idea about that? – Vivendi Mar 20 '13 at 12:20
  • I guess it is a known issue http://support.microsoft.com/kb/2486643 , so maybe the workarounds could help – V4Vendetta Mar 20 '13 at 12:23
  • @V4Vendetta I see, so it seems to be a conversion error. Could you perhaps give this all as a complete answer, so i can accept it. – Vivendi Mar 20 '13 at 12:27

1 Answers1

9

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

Community
  • 1
  • 1
V4Vendetta
  • 37,194
  • 9
  • 78
  • 82