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 2005

Tip: Looking for answers? Try searching our database.

How to automatically add class definition to proxy

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carleton Wong - 07 Feb 2005 19:34 GMT
I defined two typis in asmx file (.Net/C#/WebService):

Class Parent
{
}

Class ChildOne: Parent
{
}

[WebMethod]
public Parent[] DoSomething(int input)
{
}

The problem is that when I use wsdl.exe to generate a proxy file it
does not have ChildOne. Question: how to force wsdl automatically to
add ChildOne into the proxy file? (I currently have to manually
add it in everytime when I modify any type or interface inside
asmx file.

Thanks

Carleton
DalePres - 08 Feb 2005 01:31 GMT
http://www.DalePreston.com/Blog/Archives/2005_02_06_Archive.html

That describes how to create, inherit, and return custom classes in .Net web
services.

HTH

DalePres
MCAD, MCDBA, MCSE

>I defined two typis in asmx file (.Net/C#/WebService):
>
[quoted text clipped - 20 lines]
>
> Carleton
Dilip Krishnan - 08 Feb 2005 04:31 GMT
Hello Carleton Wong via DotNetMonster.com,
  In your web method u need to add an [XmlInclude(typeof(Childone))] Attribute

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com

> I defined two typis in asmx file (.Net/C#/WebService):
>
[quoted text clipped - 16 lines]
>
> Carleton
Bruce Johnson [C# MVP] - 08 Feb 2005 19:01 GMT
Just so that you're clear, the XmlInclude attribute doesn't copy the Childone
class to the client.  All that it does is take arrange so that the public
readable/writeable properties are available in a class within the same
namespace as the proxy class.  This might not be a problem, but it's a common
sore spot among developers who get invalid cast exceptions on the client.

Bruce Johnson [C# MVP]
http://www.objectsharp.com/blogs/bruce

> Hello Carleton Wong via DotNetMonster.com,
>    In your web method u need to add an [XmlInclude(typeof(Childone))] Attribute
[quoted text clipped - 26 lines]
> >
> > Carleton

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



©2008 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.