I am writing to write an application (winform) that will consume a webservice to retrieve countries names, within the webservice I found CdCountry class and GetCountryCode function, as seen below. How do I call the GetCountryCode to return the countries.
private void button1_Click(object sender, EventArgs e)
{
WebReference1.EDIWebService client = new WebReference1.EDIWebService();
}
(Note: below code copied from WebReference1)
[System.Xml.Serialization.XmlIncludeAttribute(typeof(PersistBaseOfCdCountry))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(CdCountry))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.xyz.com/abc/")]
public abstract partial class RetrieveBaseOfCdCountry {
}
/// <remarks/>
[System.Xml.Serialization.XmlIncludeAttribute(typeof(CdCountry))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.xyz.com/abc/")]
public abstract partial class PersistBaseOfCdCountry : RetrieveBaseOfCdCountry {
}
public partial class CdCountry : PersistBaseOfCdCountry {
private string countryIdField;
private string countryNameField;
private string nationalityField;
public string CountryId {
get {
return this.countryIdField;
}
set {
this.countryIdField = value;
}
}
public string CountryName {
get {
return this.countryNameField;
}
set {
this.countryNameField = value;
}
}
public string Nationality {
get {
return this.nationalityField;
}
set {
this.nationalityField = value;
}
}
}
public CdCountry[] GetCountryCode(string OperatorID, string SecurityKey) {
object[] results = this.Invoke("GetCountryCode", new object[] {
OperatorID,
SecurityKey});
return ((CdCountry[])(results[0]));
}