2009-04-28 42 views
12

Tôi đang vẽ đồ thị giờ để tìm ra vấn đề này.WCF + SSL không tìm thấy điểm cuối

Tôi có dịch vụ wcf mà tôi lưu trữ trên II7, tất cả đều hoạt động tốt khi tôi sử dụng giao thức http bình thường.

Tôi đã thêm các capabilites SSL và kể từ đó tôi không thể truy cập nó từ mã. Tôi có thể tạo một máy khách nhưng không thể chạy bất kỳ phương thức nào của nó.

đây là những gì tôi có

<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
      <binding name="WSHttp0"> 
       <security mode="Transport"> 
        <transport realm ="" clientCredentialType="None" /> 
       </security> 
      </binding> 
     </wsHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="https://serverName.domname.local/WCFTest/MyWebServicec.svc" 
      binding="wsHttpBinding" bindingConfiguration="WSHttp0" contract="SSLWebService.IMyWebService" 
      name="WSEP"> 
      <identity> 
       <dns value="serverName.domname.local" /> 
      </identity> 
     </endpoint> 
    </client> 
</system.serviceModel> 

Tôi đã thêm một tài liệu tham khảo phục vụ cho dự án của tôi

và tôi sử dụng nó như thế

Dim client As MyWebServiceClient = New MyWebServiceClient() 
Try 
    client.GetDocumentByDocID(5) 
Catch ex As Exception 
    MessageBox.Show(ex.Message) 
End Try 

và đây là những gì tôi nhận được

Không có điểm cuối nghe tại https://serverName.domname.local/WCFTest/MyWebService.svc có thể chấp nhận tin nhắn. Điều này thường được gây ra bởi một địa chỉ không chính xác hoặc hành động SOAP. Xem InnerException, nếu có, để biết thêm chi tiết.

Có ai có thể giúp tôi về điều này không? Tôi thật sự không hiểu chuyện gì đang xảy ra ...

lưu ý: Tôi có thể truy cập vào webservice một cách chính xác sử dụng Internet Explorer (vì vậy tôi đoán chứng của tôi là ok)

+0

nó có thể hữu ích để xem cấu hình máy chủ –

Trả lời

3

Bạn đã đúng về điều đó,

Sg sai ở phía máy chủ.

đây là cách tôi đã làm cho nó làm việc

<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
      <binding name="wsHttpEndpointBinding"> 
       <security mode="Transport"> 
        <transport clientCredentialType ="None"/> 
       </security> 
      </binding> 
     </wsHttpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="App_WcfWebService.AppWebServiceBehavior" name="App_WcfWebService.AppWebService"> 
      <endpoint address="" binding="wsHttpBinding" bindingConfiguration ="wsHttpEndpointBinding" contract="App_WcfWebService.IAppWebService"> 

      </endpoint> 
      <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
      <behavior name="App_WcfWebService.AppWebServiceBehavior"> 
       <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
       <serviceMetadata httpsGetEnabled="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="true"/> 
       <serviceThrottling maxConcurrentSessions="90" />      
      </behavior> 
     </serviceBehaviors> 
    </behaviors> 
</system.serviceModel> 
4

Tôi nghĩ rằng web.config máy chủ có thể là bị lỗi ở đây. Tôi đã có WCF trên SSL làm việc với app.config sau đây trên phía khách hàng.

<configuration> 
    <system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="WSHttpBinding_IService" > 
      <security mode="Transport"> 
      <transport realm ="" clientCredentialType="Windows" /> 
      </security> 
     </binding> 

     </wsHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="https://mycomputer/Service/Service.svc" 
      binding="wsHttpBinding" 
      bindingConfiguration="WSHttpBinding_IService" 
      contract="ServiceProxy.IService" name="WSHttpBinding_IService"> 
     <identity> 
      <dns value="mycomputer" /> 
     </identity> 
     </endpoint> 
    </client> 
    </system.serviceModel> 
</configuration> 

Điểm khác biệt duy nhất là ClientCredentialType mà tôi đã đặt thành Windows khi tôi muốn sử dụng xác thực cửa sổ tích hợp. Web.config của máy chủ bao gồm các dòng sau để thiết lập dịch vụ mà khách hàng có thể sử dụng.

<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="WindowsBinding"> 
      <security mode="Transport"> 
      <transport proxyCredentialType="Windows" /> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="Service.Service1Behavior" 
       name="Service.Service"> 
     <endpoint address="" binding="wsHttpBinding" 
        bindingConfiguration="WindowsBinding" 
        contract="ServiceInterface.IService"> 
      <identity> 
      <dns value="mycomputer" /> 
      </identity> 
     </endpoint> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="Service.Service1Behavior"> 
      <serviceMetadata httpGetEnabled="true"/> 
      <serviceDebug includeExceptionDetailInFaults="false"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 

Bạn có thể so sánh điều này với web.config ở phía máy chủ và xem điều gì khác biệt không? Hoặc thêm web.config của bạn vào câu hỏi.

Các vấn đề liên quan