PC Review


Reply
Thread Tools Rate Thread

Compile errors in .NET generated code for Web Services

 
 
=?Utf-8?B?Q2hhbmRyZXNo?=
Guest
Posts: n/a
 
      6th May 2005
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?

 
Reply With Quote
 
 
 
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      6th May 2005
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" <(E-Mail Removed)> wrote in message
news:152A1734-FB8E-4BE7-9B51-(E-Mail Removed)...
> 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?
>


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2hhbmRyZXNo?=
Guest
Posts: n/a
 
      6th May 2005
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" <(E-Mail Removed)> wrote in message
> news:152A1734-FB8E-4BE7-9B51-(E-Mail Removed)...
> > 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?
> >

>
>

 
Reply With Quote
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      7th May 2005
Could you post the wsdl or a link to it?

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Chandresh" <(E-Mail Removed)> wrote in message
news:8CF86FB6-5D48-4FB7-852B-(E-Mail Removed)...
>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" <(E-Mail Removed)> wrote in message
>> news:152A1734-FB8E-4BE7-9B51-(E-Mail Removed)...
>> > 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?
>> >

>>
>>


 
Reply With Quote
 
=?Utf-8?B?Q2hhbmRyZXNo?=
Guest
Posts: n/a
 
      9th May 2005
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" <(E-Mail Removed)> wrote in message
> news:8CF86FB6-5D48-4FB7-852B-(E-Mail Removed)...
> >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" <(E-Mail Removed)> wrote in message
> >> news:152A1734-FB8E-4BE7-9B51-(E-Mail Removed)...
> >> > 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?
> >> >
> >>
> >>

>
>

 
Reply With Quote
 
New Member
Join Date: Jan 2006
Posts: 1
 
      12th Jan 2006
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
 
Reply With Quote
 
New Member
Join Date: Jan 2007
Posts: 1
 
      31st Jan 2007
I have the same problem
 
Reply With Quote
 
fatihcewik@gmail.com
Guest
Posts: n/a
 
      17th Jul 2012
On Monday, May 9, 2005 8:42:02 PM UTC+3, Chandresh wrote:
> 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=&quot;qualified&quot;
>
> Chandresh
>
> &quot;Alex Feinman [MVP]&quot; wrote:
>
> &gt; Could you post the wsdl or a link to it?
> &gt;
> &gt; --
> &gt; Alex Feinman
> &gt; ---
> &gt; Visit http://www.opennetcf.org
> &gt; &quot;Chandresh&quot; &lt;(E-Mail Removed)&gt; wrote in message
> &gt; news:8CF86FB6-5D48-4FB7-852B-(E-Mail Removed)...
> &gt; &gt;I was afriad I'd have to do that. For me editing the proxy code manually is
> &gt; &gt; out of question; the wsdl changes frequently and it is huge. The only
> &gt; &gt; option
> &gt; &gt; is to tweak the WSDL.
> &gt; &gt;
> &gt; &gt; Any ideas what do I have to take out/ put in the wsdl so that the proxy
> &gt; &gt; generator does not emit those attributes?
> &gt; &gt;
> &gt; &gt; &quot;Alex Feinman [MVP]&quot; wrote:
> &gt; &gt;
> &gt; &gt;&gt; I'm afraid the only thing you can do is modify the web service definition
> &gt; &gt;&gt; (or edit the proxy code manually). The proxy generator is not aware of
> &gt; &gt;&gt; CF.
> &gt; &gt;&gt; It is the same one as for full framework
> &gt; &gt;&gt;
> &gt; &gt;&gt; --
> &gt; &gt;&gt; Alex Feinman
> &gt; &gt;&gt; ---
> &gt; &gt;&gt; Visit http://www.opennetcf.org
> &gt; &gt;&gt; &quot;Chandresh&quot; &lt;(E-Mail Removed)&gt; wrote in message
> &gt; &gt;&gt; news:152A1734-FB8E-4BE7-9B51-(E-Mail Removed)...
> &gt; &gt;&gt; &gt; Hi,
> &gt; &gt;&gt; &gt;
> &gt; &gt;&gt; &gt; I wonder if anyone else has seen this or suggest how to fix this. I'm
> &gt; &gt;&gt; &gt; writing an application for Pocket PC 2003 that uses web services to get
> &gt; &gt;&gt; &gt; data.
> &gt; &gt;&gt; &gt;
> &gt; &gt;&gt; &gt; I used VS2003 and created a project from the SmartApplication template;
> &gt; &gt;&gt; &gt; added a Web Reference; the stubs get generated and when I try to
> &gt; &gt;&gt; &gt; compile I
> &gt; &gt;&gt; &gt; get tons of errors in the Source Code file that gets generated when I
> &gt; &gt;&gt; &gt; added
> &gt; &gt;&gt; &gt; the web reference.
> &gt; &gt;&gt; &gt;
> &gt; &gt;&gt; &gt; The error says:
> &gt; &gt;&gt; &gt; ...\Web References\CWS\Reference.cs(724):
> &gt; &gt;&gt; &gt; 'System.Xml.Serialization.XmlArrayAttribute' does not contain a
> &gt; &gt;&gt; &gt; definition
> &gt; &gt;&gt; &gt; for 'Form'
> &gt; &gt;&gt; &gt;
> &gt; &gt;&gt; &gt; The code it complains about is:
> &gt; &gt;&gt; &gt;
> &gt; &gt;&gt; &gt; [System.Web.Services.Protocols.SoapDocumentMethodAttribute(&quot;&quot;,
> &gt; &gt;&gt; &gt; RequestNamespace=&quot;ns1&quot;, ResponseNamespace=&quot;ns1&quot;,
> &gt; &gt;&gt; &gt; Use=System.Web.Services.Description.SoapBindingUse.Literal,
> &gt; &gt;&gt; &gt; ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
> &gt; &gt;&gt; &gt; [return: System.Xml.Serialization.XmlArrayAttribute(&quot;OrderList&quot;,
> &gt; &gt;&gt; &gt; Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
> &gt; &gt;&gt; &gt; [return: System.Xml.Serialization.XmlArrayItemAttribute(&quot;order&quot;,
> &gt; &gt;&gt; &gt; Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
> &gt; &gt;&gt; &gt; public Order[]
> &gt; &gt;&gt; &gt; getOrders([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
> &gt; &gt;&gt; &gt; OrderFilter OrderFilter) {
> &gt; &gt;&gt; &gt; object[] results = this.Invoke(&quot;getOrders&quot;, new object[] {
> &gt; &gt;&gt; &gt; OrderFilter});
> &gt; &gt;&gt; &gt; return ((Order[])(results[0]));
> &gt; &gt;&gt; &gt; }
> &gt; &gt;&gt; &gt;
> &gt; &gt;&gt; &gt; It seems like it doesn't like the 'Form' attribute of XmlArrayAttribute
> &gt; &gt;&gt; &gt; and
> &gt; &gt;&gt; &gt; XmlElementAttribute.
> &gt; &gt;&gt; &gt;
> &gt; &gt;&gt; &gt; This maybe because that particular attribute is unsupported in .NET
> &gt; &gt;&gt; &gt; compact
> &gt; &gt;&gt; &gt; framework; if that is so then I wonder why it gets generated in the
> &gt; &gt;&gt; &gt; first
> &gt; &gt;&gt; &gt; place?
> &gt; &gt;&gt; &gt;
> &gt; &gt;&gt; &gt; Can I do something else so that these attributes do not get generated?
> &gt; &gt;&gt; &gt;
> &gt; &gt;&gt;
> &gt; &gt;&gt;
> &gt;
> &gt;


Could you please describe what was your change on wsdl?
I have same problem
 
Reply With Quote
 
fatihcewik@gmail.com
Guest
Posts: n/a
 
      17th Jul 2012
Could you please describe what was your change on wsdl ?
i have same problem?

Regards


On Monday, May 9, 2005 8:42:02 PM UTC+3, Chandresh wrote:
> 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=&quot;qualified&quot;
>
> Chandresh


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Designer generated code fails to compile Pat Moran Microsoft ADO .NET 3 14th Apr 2008 04:17 PM
compile errors when converting web site project to web application project John Dalberg Microsoft ASP .NET 1 28th Mar 2007 01:54 AM
W2K Error: "SVCHOST has generated errors...An error log is being generated" ? Al Dykes Windows XP General 1 14th May 2005 03:54 PM
Generated Code Won't Compile Curt Emich Microsoft Dot NET 5 25th Apr 2004 07:14 PM
Generated Code Won't Compile Curt Emich Microsoft C# .NET 3 24th Apr 2004 06:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:04 PM.