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

S

Steve

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!!
 
Q

q

FYI: .NET 2.0 fixes that critical issue. In .NET 2.0, the proxy is
properly created with public properties and private fields.
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top