Exclude property fron Webservice

Discussion in 'ASP .Net Web Services' started by mindflower, Nov 15, 2006.

  1. mindflower

    mindflower Guest

    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
     
    mindflower, Nov 15, 2006
    #1
    1. Advertising

  2. mindflower

    RYoung Guest

    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

    "mindflower" <> wrote in message
    news:...
    > 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
     
    RYoung, Nov 16, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. D. Shane Fowlkes
    Replies:
    1
    Views:
    424
    Marina
    May 19, 2005
  2. Joseph Suprenant

    converting fron unsiged char to int

    Joseph Suprenant, Aug 18, 2003, in forum: C++
    Replies:
    4
    Views:
    587
    Kevin Goodsell
    Aug 19, 2003
  3. ss
    Replies:
    1
    Views:
    1,400
    Gordon Beaton
    Jun 22, 2006
  4. Bill

    Conversion fron signed to unsigned?

    Bill, Sep 13, 2005, in forum: C Programming
    Replies:
    2
    Views:
    371
    Jirka Klaue
    Sep 13, 2005
  5. jainshasha

    to read mails fron inboxes

    jainshasha, Apr 17, 2008, in forum: Java
    Replies:
    3
    Views:
    301
    Roedy Green
    Apr 18, 2008
Loading...

Share This Page