Welcome to thinktecture forums Sign in | Join | Faq

Discussion

Started by windie at 08-05-2008 11:02 AM. Topic has 1 replies.

Print Search
Sort Posts:    
   08-05-2008, 11:02 AM
windie is not online. Last active: 8/6/2008 3:10:53 AM windie

Top 500 Posts
Joined on 08-05-2008
Posts 1
Error in Proxy Class generated by WSCF

Hi,

I have a complex element in my XSD which looks like

<xs:element name="Products">

<xs:complexType>

<xs:sequence>

<xs:element ref="pd:Prod" maxOccurs="6"/>

</xs:sequence>

</xs:complexType>

</xs:element>

And this complex element is used as a child element as shown below:

<xs:element name="ProductCatalog">

<xs:complexType>

<xs:sequence>

<xs:element ref="pd:ProdId"/>

<xs:element ref="pd:Products" minOccurs="0" maxOccurs="2"/>

</xs:sequence>

</xs:complexType>

</xs:element>

I create the WSDL and the server side code using WSCF. When I try to consume this webservice, I'm getting an error in the Reference.vb file.

Error is:  Unable to generate a temporary class (result=1).
error CS0029: Cannot implicitly convert type 'TestCatalog.Catalog.ProdType' to 'TestCatalog.Catalog.ProdType[]'

The code snippet in Reference.vb where this error occurs is:

<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.1433"), _

System.SerializableAttribute(), _

System.Diagnostics.DebuggerStepThroughAttribute(), _

System.ComponentModel.DesignerCategoryAttribute("code"), _

System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://www.w3cschools.com/Products")> _

Partial Public Class ProductCatalogType

Private ProdIdField As String

Private ProductsField()() As ProdType


And the property for this field is:

<System.Xml.Serialization.XmlArrayItemAttribute("Prod", GetType(ProdType), IsNullable:=false)> _

Public Property Products() As ProdType()()

Get

Return Me.ProductsField

End Get

Set(ByVal value As ProdType()())

Me.ProductsField = value

End Set

End Property

When I make a couple of changes in my Reference.vb file manually, i'm able to consume the webservice without any error.

The changes that i made are:

1. Changing Private ProductsField()() As ProdType  to Private ProductsField() As ProdType

2. Changing the property as:

<System.Xml.Serialization.XmlArrayItemAttribute("Prod", GetType(ProdType), IsNullable:=false)> _

Public Property Products() As ProdType()

Get

Return Me.ProductsField

End Get

Set(ByVal value As ProdType())

Me.ProductsField = value

End Set

End Property

 

If someone can tell me why this error occured, it would be of great help. Also let me know if I have to make modifications in my XSD so that I don't have to manually edit Reference.vb


   Report 
   08-11-2008, 3:18 PM
Daniel is not online. Last active: 11/11/2008 1:41:46 PM Daniel



Top 10 Posts
Joined on 05-29-2007
Швейцария
Posts 24
Re: Error in Proxy Class generated by WSCF
I got the same error and have to edit the Reference file manually after every update of the WebReference.

I'm not sure if it's possible to change it anywhere at the server side?!

Not found a solution yet.
не идея, но да

VS2005 - WSCF 0.7

   Report 
thinktecture fo... » WSCF » Discussion » Re: Error in Proxy Class generated by WSCF

Powered by Community Server, by Telligent Systems