G
Guest
I need to change the Url property in a web service proxy class in a generic way. The proxy class looks like this
public class Sender : System.Web.Services.Protocols.SoapHttpClientProtocol
...
If I instantiate the proxy class, I can set its Url property
localhost.Sender oSender = new localhost.Sender(); // proxy clas
oSender.Url = "http://server/webservice/s.asmx"
However, in order to set Url I need to look up a server name in appSettings and replace the name of server in the existing Url from 'localhost' to a name from appSettings
Therefore, I would like to make a generic method that would accept any web service proxy class and do all work
So, this method
public static void AdjustWebServiceProxyUrl(System.Web.Services.Protocols.WebClientProtocol proxyClass
allows me to call i
localhost.Sender oSender = new localhost.Sender(); // proxy clas
AdjustWebServiceProxyUrl (oSender); // works fin
However, AdjustWebServiceProxyUrl method should change the Url property and return it
In order to do that I need to pass it by reference and this is where I got stuck.
This code won't complie
public static void AdjustWebServiceProxyUrl(ref System.Web.Services.Protocols.WebClientProtocol proxyClass
localhost.Sender oSender = new localhost.Sender();
AdjustWebServiceProxyUrl (ref oSender);
Why does it compile without ref
Thanks,
-Sta
public class Sender : System.Web.Services.Protocols.SoapHttpClientProtocol
...
If I instantiate the proxy class, I can set its Url property
localhost.Sender oSender = new localhost.Sender(); // proxy clas
oSender.Url = "http://server/webservice/s.asmx"
However, in order to set Url I need to look up a server name in appSettings and replace the name of server in the existing Url from 'localhost' to a name from appSettings
Therefore, I would like to make a generic method that would accept any web service proxy class and do all work
So, this method
public static void AdjustWebServiceProxyUrl(System.Web.Services.Protocols.WebClientProtocol proxyClass
allows me to call i
localhost.Sender oSender = new localhost.Sender(); // proxy clas
AdjustWebServiceProxyUrl (oSender); // works fin
However, AdjustWebServiceProxyUrl method should change the Url property and return it
In order to do that I need to pass it by reference and this is where I got stuck.
This code won't complie
public static void AdjustWebServiceProxyUrl(ref System.Web.Services.Protocols.WebClientProtocol proxyClass
localhost.Sender oSender = new localhost.Sender();
AdjustWebServiceProxyUrl (ref oSender);
Why does it compile without ref
Thanks,
-Sta