Windows服务中的WCF服务,没有IIS,匿名身份验证?

时间:2015-10-08 18:46:41

标签: wcf wcf-binding wcf-security

您是否有人知道是否可以在没有安装IIS的情况下在Windows服务中托管wcf服务以及匿名身份验证?

我一直得到403(被禁止),因为不允许'匿名'。

VS Everythings中的本地工作,但是当我在2个不同的服务器(主机和客户端)中运行它时,我得到错误。两台服务器都不在同一个域中。

谢谢!

服务器端的

代码:

<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
    </serviceHostingEnvironment>
    <bindings>
      <wsHttpBinding>
        <binding name="Unsecured">
          <security mode="None" />
        </binding>
      </wsHttpBinding>
    </bindings>
    <services>
      <service name="WcfServiceRoelant.ServiceRoelant" behaviorConfiguration="ServiceRoelantBehavior">
        <endpoint address="" binding="wsHttpBinding" contract="WcfServiceRoelant.IServiceRoelant" bindingConfiguration="Unsecured"/>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceRoelantBehavior">
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

0 个答案:

没有答案