我尝试使用WSHttpBinding
Windows 身份验证和 HTTP 协议设置 WCF 服务,而不是 HTTPS。是否可以?我正在使用 IIS 7。当前我的配置文件如下。
使用此配置应用程序会引发异常:
找不到与绑定 WSHttpBinding 的端点的方案 http 匹配的基地址。注册的基地址方案是 []。
我的代码是:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="WsBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="WsBehavior" name="LoginService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="WsBinding" contract="ILoginService">
<identity>
<dns value="http://localhost:50001/Ws/" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" minFreeMemoryPercentageToActivateService="1">
<baseAddressPrefixFilters>
<add prefix="http://localhost:50001/Ws/" />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<bindings>
<wsHttpBinding>
<binding name="WsBinding" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="Windows" />
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>