C# webservices proxy generates public member variables and no getter/setter methods??

Discussion in 'ASP .Net Web Services' started by Steve, Mar 23, 2006.

  1. Steve

    Steve Guest

    I generate C# webservices proxy code from WSDL file, it turns out the
    classes
    generated have public member variables and no getter/setter methods as
    follows,
    and I am able to get data when running the client.


    [System.Xml.Serialization.SoapTypeAttribute("MyFeeResponse",
    "http://data.myproj.wws")]
    public class MyFeeResponse {

    /// <remarks/>
    public string feeTranSequenceNumber;

    /// <remarks/>
    public string tranNumber;
    }

    However, if I add the getter/setter methods, and changed the public
    modifier to
    private modifier, I couldn't get data when running the client.

    [System.Xml.Serialization.SoapTypeAttribute("MyFeeResponse",
    "http://data.myproj.wws")]
    public class MyFeeResponse {

    /// <remarks/>
    private string feeTranSequenceNumber;

    /// <remarks/>
    private string tranNumber;

    public string FeeTranSequenceNumber
    {
    get
    { return feeTranSequenceNumber;
    }
    set
    { feeTranSequenceNumber = value;
    }
    }

    public string TranNumber
    {
    get
    { return tranNumber;
    }
    set
    { tranNumber = value;
    }
    }

    }

    any ideas?

    please advise. thanks!!
     
    Steve, Mar 23, 2006
    #1
    1. Advertising

  2. Steve

    q Guest

    FYI: .NET 2.0 fixes that critical issue. In .NET 2.0, the proxy is
    properly created with public properties and private fields.
     
    q, Mar 24, 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. Timo Nentwig
    Replies:
    75
    Views:
    3,321
    Jon A. Cruz
    Jan 18, 2004
  2. Adam Sandler

    problem with getter and setter not working

    Adam Sandler, May 25, 2006, in forum: ASP .Net
    Replies:
    12
    Views:
    748
    Jimi200478
    May 26, 2006
  3. gamehack
    Replies:
    2
    Views:
    502
    James Stroud
    Jul 18, 2007
  4. dasacc22

    getter and setter and list appends

    dasacc22, Apr 20, 2009, in forum: Python
    Replies:
    6
    Views:
    900
    Piet van Oostrum
    Apr 25, 2009
  5. Jan Luehr
    Replies:
    2
    Views:
    178
    Jan Luehr
    Sep 1, 2010
Loading...

Share This Page