Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 20th, 2009, 06:55 AM
Authorized User
 
Join Date: Aug 2006
Posts: 41
Thanks: 1
Thanked 0 Times in 0 Posts
Default

It says in the sample which is confusing:

"Note that you can replace "GetCompletionList" with a name of your choice, but the return type and parameter name and type must exactly match, including case."
 
Old November 20th, 2009, 07:03 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It seems related to the actual implementation of the service call. They somehow need to know what data to pass to which parameters. So, I guess it'll break when you change the names although I haven't tried it.

The project's source is open so you can fix it if you don't like the behavior... ;-)

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old November 20th, 2009, 07:20 AM
Authorized User
 
Join Date: Aug 2006
Posts: 41
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Yes, it does break, as I lost a whole morning wondering why my calls to the web method wouldn't work even though my signature was the same in terms of data types....I'd named my parameters differently!

Oh and another strange about their implemtation is that they say the web method return type must be a string array, but I changed it to an arraylist just to test their theory, and it works fine! Very strange!
 
Old November 20th, 2009, 07:33 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Both are serialized pretty much the same, as an array. In the case of a string array, it's type is specified as a string:

<s:complexType name="ArrayOfString"...
... name="string" nillable="true" type="s:string"

When using an ArrayList, you get the same, but untyped:

<s:complexType name="ArrayOfAnyType" ...
... name="anyType" nillable="true" />

So, I guess from a client perspective you can treat the two as the same if you're expecting / passing strings.

If you find it cleaner, you can also use List<string> as it serializes in exactly the same was a string array does...

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
ICallbackEventHandler Interface ilegend .NET Framework 2.0 2 August 25th, 2008 10:56 PM
ICallbackEventHandler.GetCallbackResult Problem tropicalpisces ASP.NET 2.0 Professional 0 August 11th, 2008 01:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.