Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
不安全的WCF服务引发SecurityAccessDeniedException_Wcf_Security_Authentication - Fatal编程技术网

不安全的WCF服务引发SecurityAccessDeniedException

不安全的WCF服务引发SecurityAccessDeniedException,wcf,security,authentication,Wcf,Security,Authentication,正在尝试运行演示服务,我正在使用以下配置 <bindings> <basicHttpBinding> <binding name="basicBinding"> <security mode="None"> <transport clientCredentialType="None" /> </security> </binding> </ba

正在尝试运行演示服务,我正在使用以下配置

<bindings>
  <basicHttpBinding>
    <binding name="basicBinding">
      <security mode="None">
        <transport clientCredentialType="None" />
      </security>
    </binding>
  </basicHttpBinding>
  <wsHttpBinding>
    <binding name="wsBinding">
      <security mode="None">
        <transport clientCredentialType="None" />
        <message establishSecurityContext="false" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<services>
    <service behaviorConfiguration="Integration.Server.ImportServiceBehavior" name="Integration.Server.ImportService">
        <endpoint name="ImportServiceSoap" 
          behaviorConfiguration="NoIpConfiguration" 
          address="soap" binding="basicHttpBinding"
          bindingConfiguration="basicBinding"
          contract="Integration.Server.IImportService"/>
        <endpoint name="ImportServiceSoap12" 
          behaviorConfiguration="NoIpConfiguration" 
          address="soap12" binding="wsHttpBinding" 
          bindingConfiguration="wsBinding"
          contract="Integration.Server.IImportService">
            <identity>
                <dns value="localhost"/>
            </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    </service>
</services>
<behaviors>
    <serviceBehaviors>
        <behavior name="Integration.Server.ImportServiceBehavior">
            <serviceMetadata httpGetEnabled="true"/>
            <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
    </serviceBehaviors>
<endpointBehaviors>
    <behavior name="NoIpConfiguration">
      <wsdlExtensions location="http://*** external server address ***/IntegrationServer/ImportService.svc" singleFile="true"/>
    </behavior>
  </endpointBehaviors>
</behaviors>
<extensions>
  <behaviorExtensions>
    <add name="wsdlExtensions" type="WCFExtras.Wsdl.WsdlExtensionsConfig, WCFExtras, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
  </behaviorExtensions>
</extensions>

我们的行为配置(NoIpConfiguration)在哪里?这里看起来像“服务器端配置”:异常堆栈跟踪是什么?我已经在问题中添加了堆栈跟踪。只是一个猜测,但服务是否在部分信任的托管环境中运行,WCFExtras代码是否与反射有关。Emit?使用反射时,在部分信任的服务中运行可能会导致某些访问冲突。
<authentication mode="None"/>
Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at SyncTestApp.SyncServiceReference.IImportService.Sync(Employment[] employments)
   at SyncTestApp.SyncServiceReference.ImportServiceClient.Sync(Employment[] employments) in D:\Integration\SyncTestApp\Service References\SyncServiceReference\Reference.cs:line 809
   at SyncTestApp.Program.Main(String[] args) in D:\Integration\SyncTestApp\Program.cs:line 78
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()