Cannot provide access to users behind internet proxy server - wshttp endpoint
IIS (service is configured) & Windows client application uses the service for bi-directional services.
IIS Config:
<!-- Server config --> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="NoSecurity" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="50000000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <security mode="None"/> </binding> </wsHttpBinding> </bindings> <services> <service name="CcsClientDataSyncServices.CcsDataCacheSyncService" behaviorConfiguration="CcsClientDataSyncServices.CcsDataCacheSyncServiceBehavior"> <endpoint address ="" binding="wsHttpBinding" contract="CcsClientDataSyncServices.ICcsDataCacheSyncContract" bindingConfiguration="NoSecurity"/> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="CcsClientDataSyncServices.CcsDataCacheSyncServiceBehavior"> <serviceMetadata httpGetEnabled="True" /> <serviceDebug includeExceptionDetailInFaults="True" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> <!-- Client config --> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="NoSecurity" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="50000000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <security mode="None" /> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://testserver:81/CcsClientDataSyncServices/Service.svc" binding="wsHttpBinding" bindingConfiguration="NoSecurity" contract="ServiceReference.ICcsDataCacheSyncContract" name="WSHttpBinding_ICcsDataCacheSyncContract"> <identity> <servicePrincipalName value="host\rajeshtest" /> </identity> </endpoint> </client> </system.serviceModel>
Some of the client’s (windows application) pc internet connection is behind a proxy, how do I configure and what are the settings I should provide them to connect to the service?
Thnks,
Raj
Rx
Réponses
Hi Rxra,
The error message you provided did indicate that those certain clients are behind are firewall proxy and the proxy requires authentication against the client. I've posted a former article which mentioned how to supply dedicated credentials for proxy authentiation in WCF client:
#[WCF]How to supply dedicated credentials for webproxy authentication in WCF client
http://blogs.msdn.com/stcheng/archive/2008/12/03/wcf-how-to-supply-dedicated-credentials-for-webproxy-authentication.aspxThe idea here is utilize the WebRequest.DefaultProxy to supply your info. Generally, if proxy server doesn't require authentication, you can use app.config to supply proxy address info.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marqué comme réponseSteven Cheng - MSFTMSFT, Modérateurjeudi 9 juillet 2009 02:42
Toutes les réponses
- Hi,
Could you please elaborate a bit more on the exceptions / behavior you are experiencing?
--larsw
Lars Wilhelmsen | Senior Consultant | Miles, Norway | Connected Systems MVP | http://larswilhelmsen.com/ You can specify the proxy address manually if you need to:
<system.net>
<defaultProxy useDefaultCredentials="true" >
<proxy autoDetect="False" usesystemdefault="False" bypassonlocal="true" proxyaddress="http://gateway:8080" />
</defaultProxy>
</system.net>
Nordine Ben Bachir- Hi Larsw,
One of my client has a problem with synchronizing with the server and the error is as below:
- Exception has been thrown by the target of an invocation.
System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (407) Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied. ). ---> System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---
Their internet is behind a proxy , so I have to provide a proxy config in my windows application.
I dont have much knowledge in WCF security.
Thks,
Raj
Rx - Hi Nordine,
I am trying out as you said, and providing client credentials
So far didnt work, still trying out.ServiceReference.RxDataCacheSyncContractClient _cc = new RxClient.ServiceReference.RxDataCacheSyncContractClient(); _cc.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential(System.Configuration.ConfigurationSettings.AppSettings["ProxyUser"], System.Configuration.ConfigurationSettings.AppSettings["ProxyPassword"]); this.RemoteProvider = new Microsoft.Synchronization.Data.ServerSyncProviderProxy(_cc);
Thks,
Raj
Rx Hi Rxra,
The error message you provided did indicate that those certain clients are behind are firewall proxy and the proxy requires authentication against the client. I've posted a former article which mentioned how to supply dedicated credentials for proxy authentiation in WCF client:
#[WCF]How to supply dedicated credentials for webproxy authentication in WCF client
http://blogs.msdn.com/stcheng/archive/2008/12/03/wcf-how-to-supply-dedicated-credentials-for-webproxy-authentication.aspxThe idea here is utilize the WebRequest.DefaultProxy to supply your info. Generally, if proxy server doesn't require authentication, you can use app.config to supply proxy address info.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marqué comme réponseSteven Cheng - MSFTMSFT, Modérateurjeudi 9 juillet 2009 02:42
- Thanks a lot Steven.I was able to fix it today.
Rx

