Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Strange behaviour in WS-Proxy generation

Reply
Thread Tools

Strange behaviour in WS-Proxy generation

 
 
Colin Basterfield
Guest
Posts: n/a
 
      12-18-2003
Hi,

I am trying to return an ArrayList from a Web Service:

public ArrayList GetYearList()

{

int RangeStart =
Int32.Parse(ConfigurationSettings.AppSettings["YearRangeStart"]);

int RangeEnd =
Int32.Parse(ConfigurationSettings.AppSettings["YearRangeEnd"]);

ArrayList yearList = new ArrayList();

for (int i = RangeStart; i <= RangeEnd; i++)

yearList.Add(i);

return yearList;

}

When I generate the Proxy however I find that in the Proxy code it is
returning

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("<urlname>/GetYea
rList", RequestNamespace="urlname>", ResponseNamespace="urlname>",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]

public object[] GetYearList() {

object[] results = this.Invoke("GetYearList", new object[0]);

return ((object[])(results[0]));

}


/// <remarks/>

public System.IAsyncResult BeginGetYearList(System.AsyncCallback callback,
object asyncState) {

return this.BeginInvoke("GetYearList", new object[0], callback, asyncState);

}


/// <remarks/>

public object[] EndGetYearList(System.IAsyncResult asyncResult) {

object[] results = this.EndInvoke(asyncResult);

return ((object[])(results[0]));

}

So how can I turn this into an ArrayList at the 'receiving end', I tried
casting it to an ArrayList, but it say that it can't cast from an object to
an ArrayList...

Any ideas on this one please?

Many thanks

Colin B




 
Reply With Quote
 
 
 
 
Colin Basterfield
Guest
Posts: n/a
 
      12-18-2003
This works,

object[] yearList = siteSummary.GetYearList();

ArrayList yearArrayList = new ArrayList(yearList);

for (int i = 0; i < yearArrayList.Count; i++)

ddlYear.Items.Add(yearArrayList[i].ToString());





"Colin Basterfield" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I am trying to return an ArrayList from a Web Service:
>
> public ArrayList GetYearList()
>
> {
>
> int RangeStart =
> Int32.Parse(ConfigurationSettings.AppSettings["YearRangeStart"]);
>
> int RangeEnd =
> Int32.Parse(ConfigurationSettings.AppSettings["YearRangeEnd"]);
>
> ArrayList yearList = new ArrayList();
>
> for (int i = RangeStart; i <= RangeEnd; i++)
>
> yearList.Add(i);
>
> return yearList;
>
> }
>
> When I generate the Proxy however I find that in the Proxy code it is
> returning
>
>

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("<urlname>/GetYea
> rList", RequestNamespace="urlname>", ResponseNamespace="urlname>",
> Use=System.Web.Services.Description.SoapBindingUse .Literal,
> ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
>
> public object[] GetYearList() {
>
> object[] results = this.Invoke("GetYearList", new object[0]);
>
> return ((object[])(results[0]));
>
> }
>
>
> /// <remarks/>
>
> public System.IAsyncResult BeginGetYearList(System.AsyncCallback callback,
> object asyncState) {
>
> return this.BeginInvoke("GetYearList", new object[0], callback,

asyncState);
>
> }
>
>
> /// <remarks/>
>
> public object[] EndGetYearList(System.IAsyncResult asyncResult) {
>
> object[] results = this.EndInvoke(asyncResult);
>
> return ((object[])(results[0]));
>
> }
>
> So how can I turn this into an ArrayList at the 'receiving end', I tried
> casting it to an ArrayList, but it say that it can't cast from an object

to
> an ArrayList...
>
> Any ideas on this one please?
>
> Many thanks
>
> Colin B
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
debugger behaviour different to execution behaviour Andy Chambers Java 1 05-14-2007 09:51 AM
strange problems with code generation Eric_Dexter@msn.com Python 7 12-02-2006 08:52 AM
Strange taskbar behaviour (notification area) Falcon Wireless Networking 0 08-17-2004 09:03 AM
[mozilla1.6] strange behaviour with newsgroup joost68 Firefox 5 04-03-2004 03:48 AM
HTML Generation (Next Generation CGI) John W. Long Ruby 4 11-24-2003 04:24 AM



Advertisments