Please help!!!
I have an ClickOnce Application which connects to a WebServ开发者_如何学JAVAice to get data from a DB. Since I am using a proxy server in my local machine (IE web browser), I get the error "The request failed with HTTP status 403 : Forbidden.".
- Why does ClickOnce App. send proxy information about my local browser to the WebService?
- What do I need to do to bypass this, a change in the ClickOnce App. or to the WebService, what kind of change?
I am still concern why ClickOnce App. sends the information a bout IE and not about the other browsers or it sends the information about the default browser?
Thanks,
The only spot where ClickOnce uses the proxy settings is to download the application files. Thep roblem you are having has nothing to do with ClickOnce -- it's your code calling the web service.
My guess is that the problem is not that the proxy settings are being applied, but that they are NOT being applied. I'm assuming your company requires the proxy settings?
You don't say if your service is a WCF service or asmx web service or what. If it's a WCF service, you might try something like this when calling your service, so it uses the proxy settings.
YourService.YourServiceClient prx = new YourService.YourServiceClient();
System.ServiceModel.WSHttpBinding wsb =
(System.ServiceModel.WSHttpBinding)prx.Endpoint.Binding;
//proxyURi should be something like 127.0.0.1:8888
wsb.ProxyAddress = new Uri(proxyURI);
//set to true if you want to bypass proxy on intranet
wsb.BypassProxyOnLocal = false;
wsb.UseDefaultWebProxy = false;
精彩评论