2010-04-04 67 views
0

我們目前有一個WCF服務可以通過https工作。但是我們想要改變它,使其僅僅通過http工作。WCF通過http設置需要

任何人都可以告訴我什麼我需要改變,以使wcf服務通過HTTP工作。以下是我的配置文件值。除了web.config之外,還有什麼我需要用於cahnge?

任何幫助非常感謝

<system.serviceModel> 
    <serviceHostingEnvironment> 
     <baseAddressPrefixFilters> 
     <add prefix="myservername" /> 
     </baseAddressPrefixFilters> 
    </serviceHostingEnvironment> 
    <bindings> 
     <basicHttpBinding> 
      <binding name="basicHttpBinding_Windows" 
       maxReceivedMessageSize="500000000" maxBufferPoolSize="500000000" 
       messageEncoding="Mtom"> 
       <security mode="TransportWithMessageCredential"> 
       <transport clientCredentialType="Windows" /> 
       </security> 
       <readerQuotas maxDepth="500000000" 
       maxArrayLength="500000000" maxBytesPerRead="500000000" 
       maxNameTableCharCount="500000000" maxStringContentLength="500000000"/> 
      </binding> 
     </basicHttpBinding> 
    </bindings> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="myproject_Behavior"> 
      <dataContractSerializer /> 
      <synchronousReceive /> 
     </behavior> 
     </endpointBehaviors> 
     <serviceBehaviors> 
      <behavior name="WebService.WSBehavior"> 
      <serviceMetadata httpsGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
      </behavior> 
      <behavior name="WebService.Forms_WSBehavior"> 
       <serviceMetadata httpGetEnabled="true" /> 
       <serviceDebug includeExceptionDetailInFaults="false" /> 
      </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <services> 
     <service behaviorConfiguration="WebService.WSBehavior" 
       name="IMMSWebService.mywebservice_WS"> 
      <endpoint 
       address="myproject_WS" 
       binding="basicHttpBinding" 
       bindingConfiguration="basicHttpBinding_Windows" 
       bindingName="basicHttpBinding" 
       contract="WebService.ICommand"> 
       <identity> 
        <dns value="localhost" /> 
       </identity> 
      </endpoint> 
      <endpoint address="mex" 
        binding="mexHttpsBinding" 
        contract="IMetadataExchange" /> 
      <host> 
       <timeouts closeTimeout="00:10:00" openTimeout="00:10:00" /> 
      </host> 
     </service> 
     <service behaviorConfiguration="WebService.Forms_WSBehavior" 
       name="WebService.Forms_WS"> 
      <endpoint 
       address="" 
       binding="wsHttpBinding" 
       contract="WebService.IForms_WS"> 
       <identity> 
        <dns value="localhost" /> 
       </identity> 
      </endpoint> 
      <endpoint address="mex" 
        binding="mexHttpBinding" 
        contract="IMetadataExchange" /> 
     </service> 
    </services> 
    </system.serviceModel> 

回答

0

變化

<security mode="TransportWithMessageCredential"> 

<security mode="None"> 

而且改變

<endpoint address="mex" 
       binding="mexHttpsBinding" 
       contract="IMetadataExchange" /> 

<endpoint address="mex" 
       binding="mexHttpBinding" 
       contract="IMetadataExchange" /> 

最後的

httpsGetEnabled任何發生,httpGetEnabled

+0

我改變了我的配置文件中沒有,當我試圖從IE到服務,我得到這個錯誤找不到與綁定basicHttpBinding的端點符合計劃http的基址。註冊的基地址方案是[https]。 關於此操作的任何幫助 – Crishna 2010-04-04 19:05:04

+0

請參閱上面的編輯httpsGetEnabled =「true」 – Nix 2010-04-04 19:50:19

+0

這也沒有幫助。 我仍然得到相同的錯誤 – Crishna 2010-04-04 20:01:16

0

我改變了我的配置文件中沒有,當我試圖去從IE服務我得到這個錯誤可能不找到與綁定basicHttpBinding的端點匹配方案http的基地址。註冊的基地址方案是[https]。關於這個

0

下一步該怎麼做你與基址的第二個問題的任何幫助:在您的服務標籤創建<baseAddresses>元素:

<services> 
    <service behaviorConfiguration="WebService.WSBehavior" 
    name="IMMSWebService.mywebservice_WS"> 
    <endpoint 
     address="myproject_WS" 
     binding="basicHttpBinding" 
     bindingConfiguration="basicHttpBinding_Windows" 
     bindingName="basicHttpBinding" 
     contract="WebService.ICommand"> 
     <identity> 
     <dns value="localhost" /> 
     </identity> 
    </endpoint> 
    <host> 
     <baseAddresses> 
     <add baseAddress="http://yourserver:8181/YourServiceBase" /> 
     </baseAddresses> 
     <timeouts closeTimeout="00:10:00" openTimeout="00:10:00" /> 
    </host> 
    </service> 

或您的端點使用完全合格的地址

<services> 
    <service behaviorConfiguration="WebService.WSBehavior" 
    name="IMMSWebService.mywebservice_WS"> 
    <endpoint 
     address="http://yourserver:8181/YourServiceBase/myproject_WS" 
     binding="basicHttpBinding" 
     bindingConfiguration="basicHttpBinding_Windows" 
     bindingName="basicHttpBinding" 
     contract="WebService.ICommand"> 
     <identity> 
     <dns value="localhost" /> 
     </identity> 
    </endpoint> 
    <host> 
     <timeouts closeTimeout="00:10:00" openTimeout="00:10:00" /> 
    </host> 
    </service> 
+0

我在服務服務選項卡中創建了基於地址的元素,但仍然收到相同的錯誤 「無法找到與具有綁定basicHttpBinding的端點匹配方案http的基地址,註冊的基址地址方案爲[https]。」 – Crishna 2010-04-04 20:46:45

+0

你能告訴我們你使用的基地址嗎?另外:你有切換你的MEX端點使用mexHttpBinding而不是mexHttpsBinding嗎?您是否已將serviceMetadata行爲切換爲使用httpGetEnabled而不是httpsGetEnabled? – 2010-04-04 21:09:30