I have a Web Service, when I try to generate the object of it I am getting below error.
"Unable to generate a temporary class (result=1).error CS0030: Cannot convert type 'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment[]' to 'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment'error CS0030: Cannot convert type 'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment[]' to 'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment'error CS0030: Cannot convert type 'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment[]' to 'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment'error CS0029: Cannot implicitly convert type 'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment' to 'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment[]'error CS0029: Cannot implicitly convert type 'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment' to 'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment[]'error CS0029: Cannot implicitly convert type 'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment' to 'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment[]'"}
I tried changing the temp folder properties to writable but I am still getting this error. Why am I getting this error and how can I fix it?
It's a known bug that won't be fixed:
The error occurs when a complex type in the wsdl contains exactly one element with unbounded occurrence. The workaround, taken from this forum discussion (credit to Elena Kharitidi), is to add dummy attributes to such types:
<xs:sequence maxOccurs="unbounded">
<xs:element ../>
<xs:sequence>
<xs:attribute name="tmp" type="xs:string" /> <-- add this
and
<xs:sequence>
<xs:element maxOccurs="unbounded"/>
<xs:sequence>
<xs:attribute name="tmp" type="xs:string" /> <-- add this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With