Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / February 2006

Tip: Looking for answers? Try searching our database.

Returning a Generic from a web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alexander Walker - 03 Feb 2006 21:55 GMT
Hello

I have a web method that returns a List<T>

I have noticed that the proxy class generated with wsdl.exe does not return a
type of List<T> but instead it returns a type of T[] is there some way I can get
wsdl.exe or the Visual Studio IDE to generate a proxy class that will return a
List<T>?

I understand that I can edit the class generated by wsdl.exe myself but I would
prefer not to do this as I would have to edit the file every time I regenerated
the proxy

Thanks

Alex
Steven Cheng[MSFT] - 06 Feb 2006 08:11 GMT
Hi Alex,

Welcome to the MSDN newsgroup.

As for the generating client proxy for ASP.NET webservice that contains
generic types parameters/return value problem you mentioned, this is an
expected behavior due to  XML webservice's nature.

Basically, webservice only publish the WSDL document as the service
contract to client users. And client users (some webservice toolkit or
component) will generate the proxy code from the WSDL document. However,
because WSDL document  is based standard XML schema,  no matter what
platform specific types we haved used in webservice code, the WSDL document
will use standard xml schema types to represent them. And for .net
framework, such types like List, ArrayList, Collection will be represented
by xml array.  Also, using such standard xml schema types can help
different client platform able to generate the correct proxy types to map
the webservcie parameters/return values.  

Therefore, for your scenario, your webservice client is also using .net
framework and you want to have the client proxy also use the .net specific
types (the same as serverside service code), you have to manually modify
the generated proxy code.

Please feel free to let me know what you think.

Regards,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.