문제

WebHTTP 바인딩 WCF 서비스에서 전송 레벨 보안을 설정하려고합니다. 내 현재 구성은 다음과 같습니다.

 <system.serviceModel>
<client>
  <endpoint binding="webHttpBinding" bindingConfiguration="webHttp"
    contract="PrimeStreamInfoServices.IService1" name="Client" />
</client>
<bindings>
<webHttpBinding>
  <binding name="webHttp" maxBufferPoolSize="1500000"  maxReceivedMessageSize="1500000"  maxBufferSize="1500000">
  <security mode="Transport">
      <transport clientCredentialType="None"

            proxyCredentialType="None"
            realm="string" />
  </security>
  </binding>

</webHttpBinding>
</bindings>
<services>

  <service name="PrimeStreamInfoServices.Service1" behaviorConfiguration="PrimeStreamInfoServices.Service1Behavior">
    <!-- Service Endpoints -->
    <endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttp" contract="PrimeStreamInfoServices.IService1">
      <!-- 
          Upon deployment, the following identity element should be removed or replaced to reflect the 
          identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
          automatically.
      -->
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="PrimeStreamInfoServices.Service1Behavior">

      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="true"/>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<diagnostics>

  <messageLogging logMalformedMessages="true"  logMessagesAtServiceLevel="true"
    logMessagesAtTransportLevel="true" />

</diagnostics>

그러나 서비스를 실행하면 예외가 발생합니다. webhttpbinding을 바인딩하여 엔드 포인트의 체계 HTTPS와 일치하는 기본 주소를 찾을 수 없습니다. 등록 된 기본 주소 체계는 [HTTP]입니다.

나는 내가 뭔가를 놓치고 있다는 것을 알고 있으며, 내가 알아낼 수없는 다양한 것들을 시도해 왔는데, 누군가 내가해야 할 일에 대한 정보를 얻었습니까?

도움이 되었습니까?

해결책

예 - 적절한 인증서를 사용하여 HTTPS로 전환하십시오. HTTP의 경우 전송 보안은 SSL 채널에서 제공합니다. 당신은 평범한 https를 통해 WS* 전송 보안을 가질 수 없습니다.

다른 팁

나의 이전 답변을 무시하고, 나는 wshttpbinding이 webhttpbinding이 아니라고 생각하고 있었다.

HTTPS로 시작 해야하는 서비스를 호출하는 데 사용하는 주소입니다.

https : // machinename/serviceName

기본 주소를 추가 할 수 있습니까 (내부 <host> 서비스 구성 요소) HTTPS는 무엇입니까? 코드에 (또는 다중) 기본 주소를 추가하고 있습니까?

<service name="PrimeStreamInfoServices.Service1" 
         behaviorConfiguration="PrimeStreamInfoServices.Service1Behavior">
   <host>
      <baseAddresses>
         <add baseAddress="https://localhost:8080/YourService.svc" />
      </baseAddresses>
   </host>
   <!-- Service Endpoints -->
   <endpoint ......
</service>

그것이 webhttpbinding과 함께 작동하는지 100% 확실하지 않지만 시도해보십시오!

마크

올바른 WCF 구성 외에도 SSL을 활성화하기 위해 IIS 속성을 구성해야합니다 (SSL에 대한 올바른 X.509 인증서 설정 포함). 그만큼 문서 그것을하는 방법에 대한 괜찮은 정보를 가지고 있습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top