How do I create dynamic webservice client in C#

Jul 28 2004 3:36 PM
My requirement is I need to put web service name space/ url in a properties file and invoke the corresponding web service. How can I do that ? Here is the sample C# code which got generated with a wsdl utility using a wsdl file. My requirement is I should read that IP addresses, Name, namesapce from a configuration file insteadof hard coding like below. Is that possible? If yes, How? [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="MyValidationBinding", Namespace="http://33.83.76.254/")] public class Validation : System.Web.Services.Protocols.SoapHttpClientProtocol { /// public Validation() { this.Url = "http://33.83.76.254:5556/soap/rpc"; } /// [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://33.83.76.254/MyValidation", ResponseNamespace="http://33.83.76.254/MyValidation")] [return: System.Xml.Serialization.SoapElementAttribute("responseXml")] public string myvalidate(string s1, string s2) { Thanks, jcm

Answers (2)