Ollie,
Been down that road :( Unfortunately, there's not many googlets out there
with help on this and related topics. Here is some (modified) code I wrote to
do this. I also included a few other useful lines which set credentials,
timeouts, and connection limits. I hope it helps.
John
public ServiceInit()
{
MyService WebService = new MyService();
RegistryKey hklm = Registry.LocalM achine;
RegistryKey hkNterWeb = hklm.OpenSubKey (@"SOFTWARE\MyA pp\WebService") ;
RegistryKey hkConfiguration = hkNterWeb.OpenS ubKey(@"Configu ration");
WebService.Url = (String) hkConfiguration .GetValue("WebS erviceURL");
ServiceTimeout = int.Parse((Stri ng)
hkConfiguration .GetValue("WebS erviceTimeout") );
ServiceConnecti ons = int.Parse((Stri ng)
hkConfiguration .GetValue("WebS erviceConnectio ns"));
hklm.Close();
WebService.Cred entials = System.Net.Cred entialCache.Def aultCredentials ;
WebService.Time out = ServiceTimeout;
HttpWebResponse res = null;
HttpWebRequest req = (HttpWebRequest )WebRequest.Cre ate (WebService.Url );
res = (HttpWebRespons e)req.GetRespon se ();
ServicePoint currentServiceP oint = req.ServicePoin t;
currentServiceP oint.MaxIdleTim e = ServiceTimeout;
currentServiceP oint.Connection Limit = ServiceConnecti ons;
}
"Ollie Riches" wrote:
I know this has probably been asked a lot but I can't find any good exmaples
so....
Can anyone give some url's to C# code that dynaimcally generates a web
service proxy at runtime?
Cheers
Ollie Riches
http://www.phoneanalyser.net
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.