2012-05-21 3 views
1

WCF 서비스를 사용해야하는 실버 라이트 애플리케이션을 개발하도록 지정되었습니다. 이 서비스는 WsHttpBinding을 사용하는 엔드 포인트 만 노출했습니다.WCF 서비스에 대한 연결을 보호하는 방법은 무엇입니까? WsHttpBinding을 사용하는 Silverlight WCF 서비스.

실버 라이트 어플리케이션에서이 서비스를 사용하는 것이 불가능하다는 것을 이해 했으므로 (WsHttpBinding은 특별한 운영 체제 지원이 필요합니까?).

서비스를 호출 할 때마다 매개 변수로 사용자 자격 증명이 있습니다. 긴 도입

<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
      <binding name="WSHttpBinding_IScheduleService" closeTimeout="00:01:00" 
       openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
       bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
       maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
       messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 
       allowCookies="false"> 
       <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
        maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
       <reliableSession ordered="true" inactivityTimeout="00:10:00" 
        enabled="false" /> 
       <security mode="Transport"> 
        <transport clientCredentialType="None" proxyCredentialType="None" 
         realm="" /> 
        <message clientCredentialType="Windows" negotiateServiceCredential="true" /> 
       </security> 
      </binding> 
     </wsHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="blahblah/Service.svc/ws" 
      binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IScheduleService" 
      contract="ScheduleService.IScheduleService" name="WSHttpBinding_IScheduleService"> 
      <identity> 
       <dns value="localhost" /> 
      </identity> 
     </endpoint> 
    </client> 
</system.serviceModel> 

죄송합니다, 그리고 질문이있다 :

이 생성 서비스에 대한 구성 닷넷 4 응용 프로그램의 모습입니다.

Silverlight 세계에서 WCF 서비스에 대한 연결을 보호하기위한 일반적인 aproaches는 무엇입니까? Silverlight 클라이언트에서 서비스를 변경하고 소비하는 방법은 무엇입니까?

답변

2

가장 일반적인 방법은이 설정에서와 마찬가지로 전송 보안 (ssl)을 사용하는 것입니다. 여기서 유일한 문제는 wshttpbinding이 실버 라이트가 지원하지 않는 ws-addressing 헤더 (fiddler 또는 wcf 로깅에서 확인)를 포함하는 클라이언트 비누 메시지를 기대할 수 있다는 것입니다.

나는 basicHttpBinding으로 서비스를 변경할 수 있다면 최선이라고 말할 것이다. 그렇지 않으면 여전히 할 수 있지만 수동으로 비누 메시지에 헤더를 푸시해야합니다. 작동하는 비누 클라이언트 (winforms)를 작성하고 비누가 어떻게 보일지 확인하십시오. 그런 다음 message inspector on silverlight을 사용하여 추가하십시오.