Re: Error when WebMethod returns a jagged array

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: MikeL (mikelpez_at_optonline.net)
Date: 02/09/05


Date: Wed, 9 Feb 2005 07:32:19 -0500

Hi, Bruce. Thanks for responding.

That certainly addresses my problem. If you don't mind I have three
additional questions:

1) Why would XSD.exe generate jagged arrays if the generated code can't be
compiled?
2) The article states to change the app's .config file. Is this the
web.config file of my webservice project? The reason I ask is because that's
exactly what I changed and nothing peristed.
3) The article offered no solution. Do you have any suggestions for a
solution?

Thanks again,

Mike

"Bruce Johnson [C# MVP]" <bruce@spammenot.objectsharp.com> wrote in message
news:3E23F7BC-DDC7-445F-BD04-48D3F886BEAD@microsoft.com...
> This type of error is usually indicative of something bad going on when
> the
> web service tries to generate the class that is used to serialize the
> incoming and outgoing messages. Check out
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp
> to a description of how to identify these sorts of problems, paying
> particular attention to the section towards the bottom that describes how
> to
> keep the compiled code around.
>
> Hope this helps.
>
> Bruce Johnson [C# MVP]
> http://www.objectsharp.com/blogs/bruce
>
> "MikeL" wrote:
>
>> Hello.
>>
>> I've been getting an error message like the following when testing a
>> webservice that I'm creating:
>>
>> "File or assembly name 8rsiphqb.dll, or one of its
>> dependencies,
>> was not found."
>>
>> Each time I refresh the page the .dll name changes, which tells me that
>> the
>> CLR is generating this .dll (right?)
>>
>> I think I narrowed down the problem: It seems only to happen when the
>> return
>> type of the WebMethod contains a jagged array. Here's what the XSD.exe
>> utility generated from my schema:
>>
>> [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.myService.com/RatingHub")]
>> [System.Xml.Serialization.XmlRootAttribute(Namespace="http://www.myService.com/RatingHub",
>> IsNullable=false)]
>>
>> public class scPlan
>>
>> {
>>
>>
>> /// <remarks/>
>>
>> [System.Xml.Serialization.XmlArrayItemAttribute(typeof(scTermRate),
>> IsNullable=false)]
>>
>> public scTermRate[][] scTermRates;
>>
>>
>> /// <remarks/>
>>
>> [System.Xml.Serialization.XmlArrayItemAttribute(typeof(scSurcharge),
>> IsNullable=false)]
>>
>> public scSurcharge[][] scSurcharges;
>>
>>
>> /// <remarks/>
>>
>> [System.Xml.Serialization.XmlAttributeAttribute()]
>>
>> public string code;
>>
>>
>> /// <remarks/>
>>
>> [System.Xml.Serialization.XmlAttributeAttribute()]
>>
>> public string description;
>>
>> }
>>
>> When I set a breakpoint on the first line of the WebMethod in the .asmx
>> file
>> it is never reached, the error is generated in the browser.
>>
>> Does anyone know what's going on?
>>
>> Thanks in advance,
>>
>> Mike
>>
>>
>>


Quantcast