Compile errors in .NET generated code for Web Services

G

Guest

Hi,

I wonder if anyone else has seen this or suggest how to fix this. I'm
writing an application for Pocket PC 2003 that uses web services to get data.

I used VS2003 and created a project from the SmartApplication template;
added a Web Reference; the stubs get generated and when I try to compile I
get tons of errors in the Source Code file that gets generated when I added
the web reference.

The error says:
....\Web References\CWS\Reference.cs(724):
'System.Xml.Serialization.XmlArrayAttribute' does not contain a definition
for 'Form'

The code it complains about is:

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
RequestNamespace="ns1", ResponseNamespace="ns1",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlArrayAttribute("OrderList",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[return: System.Xml.Serialization.XmlArrayItemAttribute("order",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
public Order[]
getOrders([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] OrderFilter OrderFilter) {
object[] results = this.Invoke("getOrders", new object[] {
OrderFilter});
return ((Order[])(results[0]));
}

It seems like it doesn't like the 'Form' attribute of XmlArrayAttribute and
XmlElementAttribute.

This maybe because that particular attribute is unsupported in .NET compact
framework; if that is so then I wonder why it gets generated in the first
place?

Can I do something else so that these attributes do not get generated?
 
A

Alex Feinman [MVP]

I'm afraid the only thing you can do is modify the web service definition
(or edit the proxy code manually). The proxy generator is not aware of CF.
It is the same one as for full framework
 
G

Guest

I was afriad I'd have to do that. For me editing the proxy code manually is
out of question; the wsdl changes frequently and it is huge. The only option
is to tweak the WSDL.

Any ideas what do I have to take out/ put in the wsdl so that the proxy
generator does not emit those attributes?

Alex Feinman said:
I'm afraid the only thing you can do is modify the web service definition
(or edit the proxy code manually). The proxy generator is not aware of CF.
It is the same one as for full framework

--
Alex Feinman
---
Visit http://www.opennetcf.org
Chandresh said:
Hi,

I wonder if anyone else has seen this or suggest how to fix this. I'm
writing an application for Pocket PC 2003 that uses web services to get
data.

I used VS2003 and created a project from the SmartApplication template;
added a Web Reference; the stubs get generated and when I try to compile I
get tons of errors in the Source Code file that gets generated when I
added
the web reference.

The error says:
...\Web References\CWS\Reference.cs(724):
'System.Xml.Serialization.XmlArrayAttribute' does not contain a definition
for 'Form'

The code it complains about is:

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
RequestNamespace="ns1", ResponseNamespace="ns1",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlArrayAttribute("OrderList",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[return: System.Xml.Serialization.XmlArrayItemAttribute("order",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
public Order[]
getOrders([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
OrderFilter OrderFilter) {
object[] results = this.Invoke("getOrders", new object[] {
OrderFilter});
return ((Order[])(results[0]));
}

It seems like it doesn't like the 'Form' attribute of XmlArrayAttribute
and
XmlElementAttribute.

This maybe because that particular attribute is unsupported in .NET
compact
framework; if that is so then I wonder why it gets generated in the first
place?

Can I do something else so that these attributes do not get generated?
 
A

Alex Feinman [MVP]

Could you post the wsdl or a link to it?

--
Alex Feinman
---
Visit http://www.opennetcf.org
Chandresh said:
I was afriad I'd have to do that. For me editing the proxy code manually is
out of question; the wsdl changes frequently and it is huge. The only
option
is to tweak the WSDL.

Any ideas what do I have to take out/ put in the wsdl so that the proxy
generator does not emit those attributes?

Alex Feinman said:
I'm afraid the only thing you can do is modify the web service definition
(or edit the proxy code manually). The proxy generator is not aware of
CF.
It is the same one as for full framework

--
Alex Feinman
---
Visit http://www.opennetcf.org
Chandresh said:
Hi,

I wonder if anyone else has seen this or suggest how to fix this. I'm
writing an application for Pocket PC 2003 that uses web services to get
data.

I used VS2003 and created a project from the SmartApplication template;
added a Web Reference; the stubs get generated and when I try to
compile I
get tons of errors in the Source Code file that gets generated when I
added
the web reference.

The error says:
...\Web References\CWS\Reference.cs(724):
'System.Xml.Serialization.XmlArrayAttribute' does not contain a
definition
for 'Form'

The code it complains about is:

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
RequestNamespace="ns1", ResponseNamespace="ns1",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlArrayAttribute("OrderList",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[return: System.Xml.Serialization.XmlArrayItemAttribute("order",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
public Order[]
getOrders([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
OrderFilter OrderFilter) {
object[] results = this.Invoke("getOrders", new object[] {
OrderFilter});
return ((Order[])(results[0]));
}

It seems like it doesn't like the 'Form' attribute of XmlArrayAttribute
and
XmlElementAttribute.

This maybe because that particular attribute is unsupported in .NET
compact
framework; if that is so then I wonder why it gets generated in the
first
place?

Can I do something else so that these attributes do not get generated?
 
G

Guest

I fixed it.

I had to tweak the WSDL. My changes were to add the following attribute to
the SCHEMA elements within the TYPES element of the WSDL:

elementFormDefault="qualified"

Chandresh

Alex Feinman said:
Could you post the wsdl or a link to it?

--
Alex Feinman
---
Visit http://www.opennetcf.org
Chandresh said:
I was afriad I'd have to do that. For me editing the proxy code manually is
out of question; the wsdl changes frequently and it is huge. The only
option
is to tweak the WSDL.

Any ideas what do I have to take out/ put in the wsdl so that the proxy
generator does not emit those attributes?

Alex Feinman said:
I'm afraid the only thing you can do is modify the web service definition
(or edit the proxy code manually). The proxy generator is not aware of
CF.
It is the same one as for full framework

--
Alex Feinman
---
Visit http://www.opennetcf.org
Hi,

I wonder if anyone else has seen this or suggest how to fix this. I'm
writing an application for Pocket PC 2003 that uses web services to get
data.

I used VS2003 and created a project from the SmartApplication template;
added a Web Reference; the stubs get generated and when I try to
compile I
get tons of errors in the Source Code file that gets generated when I
added
the web reference.

The error says:
...\Web References\CWS\Reference.cs(724):
'System.Xml.Serialization.XmlArrayAttribute' does not contain a
definition
for 'Form'

The code it complains about is:

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
RequestNamespace="ns1", ResponseNamespace="ns1",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlArrayAttribute("OrderList",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[return: System.Xml.Serialization.XmlArrayItemAttribute("order",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
public Order[]
getOrders([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
OrderFilter OrderFilter) {
object[] results = this.Invoke("getOrders", new object[] {
OrderFilter});
return ((Order[])(results[0]));
}

It seems like it doesn't like the 'Form' attribute of XmlArrayAttribute
and
XmlElementAttribute.

This maybe because that particular attribute is unsupported in .NET
compact
framework; if that is so then I wonder why it gets generated in the
first
place?

Can I do something else so that these attributes do not get generated?
 
Joined
Jan 12, 2006
Messages
1
Reaction score
0
Hey Alex,


the same problem has occured within my smart device project.
Tweaking the wsdl didnt bring success.

Can you explain me in detail how you did solve the problem....

For example, did you remove all of the "Form=..." Attributes.
How did you extend the wsdl?


Thanks in advance


Erhan Tamer
 
F

fatihcewik

I fixed it.

I had to tweak the WSDL. My changes were to add the following attribute to
the SCHEMA elements within the TYPES element of the WSDL:

elementFormDefault="qualified"

Chandresh

"Alex Feinman [MVP]" wrote:

> Could you post the wsdl or a link to it?
>
> --
> Alex Feinman
> ---
> Visit http://www.opennetcf.org
> "Chandresh" <[email protected]> wrote in message
> > >I was afriad I'd have to do that. For me editing the proxy code manually is
> > out of question; the wsdl changes frequently and it is huge. The only
> > option
> > is to tweak the WSDL.
> >
> > Any ideas what do I have to take out/ put in the wsdl so that the proxy
> > generator does not emit those attributes?
> >
> > "Alex Feinman [MVP]" wrote:
> >
> >> I'm afraid the only thing you can do is modify the web service definition
> >> (or edit the proxy code manually). The proxy generator is not aware of
> >> CF.
> >> It is the same one as for full framework
> >>
> >> --
> >> Alex Feinman
> >> ---
> >> Visit http://www.opennetcf.org
> >> "Chandresh" <[email protected]> wrote in message
> >> > >> > Hi,
> >> >
> >> > I wonder if anyone else has seen this or suggest how to fix this. I'm
> >> > writing an application for Pocket PC 2003 that uses web services to get
> >> > data.
> >> >
> >> > I used VS2003 and created a project from the SmartApplication template;
> >> > added a Web Reference; the stubs get generated and when I try to
> >> > compile I
> >> > get tons of errors in the Source Code file that gets generated when I
> >> > added
> >> > the web reference.
> >> >
> >> > The error says:
> >> > ...\Web References\CWS\Reference.cs(724):
> >> > 'System.Xml.Serialization.XmlArrayAttribute' does not contain a
> >> > definition
> >> > for 'Form'
> >> >
> >> > The code it complains about is:
> >> >
> >> > [System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
> >> > RequestNamespace="ns1", ResponseNamespace="ns1",
> >> > Use=System.Web.Services.Description.SoapBindingUse.Literal,
> >> > ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
> >> > [return: System.Xml.Serialization.XmlArrayAttribute("OrderList",
> >> > Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
> >> > [return: System.Xml.Serialization.XmlArrayItemAttribute("order",
> >> > Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
> >> > public Order[]
> >> > getOrders([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
> >> > OrderFilter OrderFilter) {
> >> > object[] results = this.Invoke("getOrders", new object[] {
> >> > OrderFilter});
> >> > return ((Order[])(results[0]));
> >> > }
> >> >
> >> > It seems like it doesn't like the 'Form' attribute of XmlArrayAttribute
> >> > and
> >> > XmlElementAttribute.
> >> >
> >> > This maybe because that particular attribute is unsupported in .NET
> >> > compact
> >> > framework; if that is so then I wonder why it gets generated in the
> >> > first
> >> > place?
> >> >
> >> > Can I do something else so that these attributes do not get generated?
> >> >
> >>
> >>
>
>

Could you please describe what was your change on wsdl?
I have same problem
 
F

fatihcewik

Could you please describe what was your change on wsdl ?
i have same problem?

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top