简体   繁体   English

在WCF服务中更改安全模式时出错

[英]Error when change security mode in wcf service

I am trying to create wcf service using wshttpbinding but whenever i change the securitymode it always getting error not matter how i modify it with the sample from google 我正在尝试使用wshttpbinding创建wcf服务,但是每当我更改安全模式时,总是会出错,无论我如何用Google的示例对其进行修改

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
  <serviceActivations>
    <add relativeAddress="General.svc" service="SMJ.Services.GeneralService" />
  </serviceActivations>
</serviceHostingEnvironment>
<bindings>
  <wsHttpBinding>
    <binding closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
   maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
      messageEncoding="Text" textEncoding="utf-8" 
      useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16348"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<services>
  <service name="SMJ.Services.GeneralService" behaviorConfiguration="ServiceBehaviors" >
    <endpoint contract="SMJ.Services.IGeneralService" binding="wsHttpBinding"></endpoint>
  </service>
</services>
<behaviors>
  <serviceBehaviors >
    <behavior name="ServiceBehaviors"  >
      <serviceMetadata httpGetEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

and when i change the security mode to another it will show this error Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. 当我将安全模式更改为另一安全模式时,它将显示此错误。找不到与绑定WSHttpBinding的端点的方案https匹配的基地址。 Registered base address schemes are [http]. 注册的基址方案为[http]。

The server is IIS 7 but the problem is when i am under development 服务器是IIS 7,但问题是我在开发中

Please help me 请帮我

ok I found the solution with using IIS Express and at the web project at the properties windows set the SSL Enabled to true. 好的,我找到了使用IIS Express的解决方案,并在Web项目的属性窗口中将SSL Enabled设置为true。 Thanks's for the advice 谢谢你的建议

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM