Exclude property fron Webservice

M

mindflower

lets say i have a User with three properties, ID, Name and InternalName and i
have a WebMethod UpdateUser(User u). Now I would like to ignore the property
InternalName in the WDSL definition. Is there a possibilty to do that, e.g.
by an attribute on the property definition? The background is that i would
like to use my business object definitions in the webservices, but hide some
of the properties from the outside.

Thanks for any hint

Stefan
 
R

RYoung

I think if you add the XmlIgnore attribute to the property it will do what
you need.

class User
{
[XmlIgnore]
public string InternalName;

public string ID;
}

Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top