2011-01-10 23 views
5

मैं SSL पर एक बाकी WCF सेवा को कॉन्फ़िगर करने की कोशिश कर रहा हूँ और मैं बार आ रही है:बाकी WCF सेवा से अधिक एसएसएल

बाध्यकारी WebHttpBinding साथ endpoint के लिए एक आधार का पता है कि मैचों योजना https नहीं मिल सका। पंजीकृत आधार पता योजनाएं [http] हैं।

क्या कोई मेरी कॉन्फ़िगरेशन फ़ाइल को देख सकता है? धन्यवाद।

<system.web> 
    <compilation debug="true" targetFramework="4.0" /> 
    </system.web> 
    <system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="wsHttpBinding1"> 
      <security> 
      <message clientCredentialType="UserName" /> 
      </security> 
     </binding> 
     </wsHttpBinding> 
     <mexHttpsBinding> 
     <binding name="mexHttpsBinding1"/> 
     </mexHttpsBinding> 
     <webHttpBinding> 
     <binding name="webHttpBinding1"> 
      <security mode="Transport" /> 
     </binding> 
     </webHttpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="serviceBehavior" name="CompanyX.WebServices.WebApi"> 
     <endpoint address="" behaviorConfiguration="WebApiBehavior" binding="webHttpBinding" 
      bindingConfiguration="webHttpBinding1" contract="CompanyX.WebServices.IWebApi"> 
      <identity> 
      <certificateReference x509FindType="FindBySubjectName" findValue="CompanyXDev" 
       isChainIncluded="false" storeName="My" storeLocation="LocalMachine" /> 
      </identity> 
     </endpoint> 
     <endpoint binding="mexHttpsBinding" bindingConfiguration="mexHttpsBinding1" 
      name="mex" contract="IMetadataExchange" /> 
     </service> 
    </services> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="WebApiBehavior"> 
      <webHttp /> 
     </behavior> 
     </endpointBehaviors> 
     <serviceBehaviors> 
     <behavior name="serviceBehavior"> 
      <serviceMetadata httpsGetEnabled="true" httpGetBinding="" httpsGetBinding="webHttpBinding" 
      httpsGetBindingConfiguration="webHttpBinding1" /> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
      <serviceCredentials> 
      <clientCertificate> 
       <certificate findValue="CompanyXDev" x509FindType="FindBySubjectName" /> 
      </clientCertificate> 
      <serviceCertificate findValue="CompanyXDev" x509FindType="FindBySubjectName" /> 
      <userNameAuthentication userNamePasswordValidationMode="Custom" 
       customUserNamePasswordValidatorType="CompanyX.WebServices.CredentialsValidator, CompanyX.WebServices" /> 
      <peer> 
       <certificate findValue="CompanyXDev" storeLocation="LocalMachine" 
       x509FindType="FindBySubjectName" storeName="My" /> 
      </peer> 
      <issuedTokenAuthentication> 
       <knownCertificates> 
       <add findValue="CompanyXDev" storeLocation="LocalMachine" storeName="My" 
        x509FindType="FindBySubjectName" /> 
       </knownCertificates> 
      </issuedTokenAuthentication> 
      </serviceCredentials> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" 
     multipleSiteBindingsEnabled="true"/> 
    </system.serviceModel> 
<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 

</configuration> 
+5

लगता है कि आपने अपने सेवा मेजबान कॉन्फ़िगर किया गया से अधिक छोटा सा है, नहीं आप ? –

+0

Ladislav Mrnka टिप्पणी ने मुझे हंसते हुए +1 किया। – Anders

+0

ओह देखो, एक और गरीब आत्मा उस सेवा की पौराणिक धारणा का पीछा करती है जो रीस्टफुल और आरपीसी दोनों है। –

उत्तर

3

आप IIS में बाध्यकारी एक https जोड़ने की जरूरत है।

    आईआईएस
  1. 'बाइंडिंग ...' सही पर क्रियाएं पैनल में क्लिक करें में आपकी साइट के लिए
  2. नेविगेट।
  3. 'जोड़ें'
  4. 'https' चुनें और प्रमाणपत्र चुनें।
5

मुझे अनुमान लगाएं: आप विजुअल स्टूडियो से डेवलपमेंट वेब सर्वर (कैसिनी) में अपनी सेवा चला रहे हैं, है ना? विकास वेब सर्वर HTTPS का समर्थन नहीं करता है। आपको आईआईएस में अपनी सेवा होस्ट करना है और साइट के लिए एचटीटीपीएस बाध्यकारी जोड़ने के लिए ग्रेग की सलाह का पालन करना है।

2

दो विकल्प:

  1. अंतिम बिंदुओं में पूरा पता निर्दिष्ट करें।

  2. कहीं टैग में मेजबान के लिए इस्तेमाल किया आधार पते निर्दिष्ट करें, उदाहरण के लिए:

<host> 
    <baseAddresses> 
    <add baseAddress="http://localhost:8000/service"/> 
    <add baseAddress="https://localhost:8001/service"/> 
    </baseAddresses> 
</host> 
संबंधित मुद्दे