469,647 Members | 1,769 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

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

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("MyFeeR esponse",
"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("MyFeeR esponse",
"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!!

Mar 23 '06 #1
1 1733
q
FYI: .NET 2.0 fixes that critical issue. In .NET 2.0, the proxy is
properly created with public properties and private fields.

Mar 24 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Lars Plessmann | last post: by
10 posts views Thread by Zap | last post: by
13 posts views Thread by Adam H. Peterson | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.