2012-11-21 24 views
5

Tôi đã bật https ràng buộc, nhưng WSDL của tôi có địa chỉ xà phòng http. Bất kỳ ý tưởng tại sao? Cảm ơn!Tại sao WSDL của tôi vẫn hiển thị liên kết http cơ bản với giá trị vị trí của http?

<wsdl:service name="XXXX"><wsdl:port name="BasicHttpBinding_XXXXService" binding="i0:BasicHttpBinding_XXXService"> 
    <soap:address location="http://dev-soa-app/XXXX/XXXX/XXXService.svc"/></wsdl:port> 
</wsdl:service> 

Đây là tập tin web.config của tôi:

<?xml version="1.0"?> 
<configuration> 

    <system.web> 
    <customErrors mode="Off"/> 
    <compilation debug="true" targetFramework="4.0" /> 
    </system.web> 
    <configProtectedData> 
    <providers> 
     <add name="ConnStrings" type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" keyContainerName="ConnStrings" cspProviderName="" useMachineContainer="true" useOAEP="false"/> 
    </providers> 
    </configProtectedData> 
    <connectionStrings configSource="ConnStrings\ConnStrings.config"/> 
    <system.serviceModel> 
    <services> 
     <service name="XXXXService"> 
     <!-- Use a bindingNamespace to eliminate tempuri.org --> 
     <endpoint address="" name="XXXXService" 
        binding ="wsHttpBinding" bindingConfiguration="TransportSecurity" 
        bindingNamespace="WF.CT2.WebServices.XXXXService" 
        contract="WF.CT2.WebServices.XXXXService.SAMLService" /> 
     <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="TransportSecurity"> 
      <security mode="Transport"> 
      <transport clientCredentialType="None"/> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
      <serviceMetadata httpsGetEnabled="true" httpGetEnabled ="false" /> 
      <!-- 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> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 

</configuration> 

Trả lời

7

Trước hết, bạn nên nhận ra rằng các URL trong các yếu tố service của WSDL chỉ là một gợi ý. Khách hàng của bạn không nên phụ thuộc vào địa chỉ này là địa chỉ chính xác của dịch vụ.

Thứ hai, nhận ra rằng nếu dịch vụ của bạn được lưu trữ trong IIS, thì đó là IIS xác định địa chỉ để đặt trong phần tử đó, dựa trên các ràng buộc của bạn trong IIS. Tôi nghi ngờ rằng bạn đã bật cả HTTP và HTTPS trên trang web lưu trữ dịch vụ. Bạn thường có thể chuyển sang HTTPS bằng cách thiết lập thuộc tính "Require SSL" trên trang SSL trong IIS Manager.

+0

Cảm ơn John! Chính xác câu trả lời tôi đang tìm kiếm. – WinFXGuy

0

Xóa httpGetEnabled = "false" khỏi Web.Config và giữ httpsGetEnabled = "true" như (xem bên dưới).

<serviceBehaviors> 
    <behavior> 
    <serviceMetadata httpsGetEnabled="true" /> 
    <serviceDebug includeExceptionDetailInFaults="false"/> 
</behavior> 
Các vấn đề liên quan