2012-03-25 107 views
5

IM特林創建這個postwcf提供的URI方案'http'無效;預期的「https」

文件傳輸的基礎,當我在本地測試一下它的工作很大

設置我的服務使用IIS的服務器上沒有SSL

這是我的服務器配置:

<system.serviceModel> 
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"/> 
<bindings> 
    <wsHttpBinding> 
    <binding name="TransferService" maxReceivedMessageSize="2147483647"> 
     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/> 
     <security mode="None" /> 
    </binding> 
    </wsHttpBinding> 
</bindings> 

<services> 
    <service behaviorConfiguration="TransferServiceBehavior" name="WcfFTP.FtpService"> 
    <endpoint address="FtpService.svc" binding="wsHttpBinding" bindingConfiguration="TransferService" contract="WcfFTP.IFileTransfer"/> 
    <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"/> 
    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="TransferServiceBehavior"> 
     <serviceMetadata httpGetEnabled="true"/> 
     <dataContractSerializer maxItemsInObjectGraph="2147483647"/> 
     <serviceDebug includeExceptionDetailInFaults="true"/> 
     <serviceThrottling maxConcurrentCalls="500" maxConcurrentSessions="500" maxConcurrentInstances="500"/> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 

和多數民衆贊成我的客戶:

<system.serviceModel> 
<bindings> 
    <wsHttpBinding> 
    <binding name="WSHttpBinding_IFileTransfer" closeTimeout="00:01:00" 
     openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
     bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
     maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" 
     textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> 
     <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
     maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
     <reliableSession ordered="true" inactivityTimeout="00:10:00" 
     enabled="false" /> 

     <security mode="TransportWithMessageCredential"> 
     <transport clientCredentialType="Digest" proxyCredentialType="None" 
      realm="" /> 
     <message clientCredentialType="Windows" negotiateServiceCredential="true" /> 
     </security> 
    </binding> 
    </wsHttpBinding> 
</bindings> 
<client> 
    <endpoint address="http://www.myhost.com/WsFTP/FtpService.svc" 
    binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IFileTransfer" 
    contract="FtpWcfClient.IFileTransfer" name="WSHttpBinding_IFileTransfer" /> 
</client> 

IV被特林與此安全問題的淨一定的幫助,但這個錯誤似乎是斯特朗

回答

7

客戶端和服務器,您綁定配置不兼容。服務器沒有指定安全性,但客戶機指定了TransportWithMessageCredential。你可以在客戶端配置中將安全模式設置爲無。


我強烈建議你使用WCF configuration editor過,它爲您節省對許多常見的錯誤,如拼寫錯誤,錯配結合等

+0

OK IV嘗試過也,這是我得到的錯誤:HTTP請求被禁止客戶端認證方案'匿名'我怎麼能沒有ssl呢?我不會把https放在我的網站上,但我仍然想用wcf來控制文件夾,而不是ftp iv [問] %20提供的%20%20URI%20方案%20http%20is%20無效%20期待%20https%20) – 2012-03-29 11:35:46

+0

我需要與roy.d相同的答案,所提供的答案不允許我使用http和Windows身份驗證。謝謝! – JDPeckham 2015-07-22 16:36:19

相關問題