Microsoft Developer Network > 포럼 홈 > Windows Communication Foundation > Cannot provide access to users behind internet proxy server - wshttp endpoint
질문하기질문하기
 

답변됨Cannot provide access to users behind internet proxy server - wshttp endpoint

  • 2009년 7월 2일 목요일 오후 2:15Rxra 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     코드 있음

    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

답변

모든 응답

  • 2009년 7월 3일 금요일 오후 8:52Lars WilhelmsenMVP, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    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/
  • 2009년 7월 3일 금요일 오후 9:23Nordine Ben Bachir 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    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
  • 2009년 7월 6일 월요일 오후 8:50Rxra 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    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
  • 2009년 7월 6일 월요일 오후 8:56Rxra 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     코드 있음
    Hi Nordine,
    I am trying out as you said, and providing client credentials
    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);
    
    So far didnt work, still trying out.

    Thks,
    Raj

    Rx
  • 2009년 7월 8일 수요일 오전 8:23Steven Cheng - MSFTMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

    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.aspx

    The 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.
  • 2009년 7월 10일 금요일 오후 4:04Rxra 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Thanks a lot Steven.
    I was able to fix it today.


    Rx