WCF 서비스 localhost가 설치된 PC가 있는데 C# 프로그램에서이 서비스에 대한 참조를 추가 할 수 있습니다. 그러나 프로그램을 실행할 때 Access Denied 오류가 발생합니다. 나는 Access Denied와 다른 어떤 정보도 얻지 못한다.WCF 액세스가 거부 됨
누구에게 할 일에 대한 제안 사항이 있습니까? 동일한 컴퓨터를 사용하지만 동일한 컴퓨터의 localhosted 버전에 연결할 수있는 다른 컴퓨터가 있습니다. 이미 게시 된 다른 질문을 살펴 봤지만 아무 것도 맞지 않습니다.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="BasicHttpBinding_IService1" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:2745/ActDemo/Service.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
contract="ActWS.IService" name="BasicHttpBinding_IService" />
<endpoint address="http://localhost/ActDemo/Service.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
contract="Act.IService" name="BasicHttpBinding_IService1" />
</client>
</system.serviceModel>
</configuration>`
코드 : - - : 편집
....
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.diagnostics>
<sources>
<source name="System.IdentityModel" switchValue="All">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="IdentityModelListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="C:\Tracing\App_identitymodellog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="IdentityModelListener" traceOutputOptions="Timestamp, Callstack">
<filter type="" />
</add>
</sharedListeners>
<trace autoflush="true" />
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies></assemblies></compilation>
<identity impersonate="true" userName="domain\username" password="password" />
<hostingEnvironment shadowCopyBinAssemblies="false"/>
<trust level="Full" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
과의 app.config는
using ActDemoApp;
namespace ActDemoApp
{
class Program
{
static void Main(string[] args)
{
string strXML="";
string strRetXML = "";
try
{
ActWS.IService oService;
ActWS.Request oRequest = new ActWS.Request();
ActWS.Response oResponse;
ActWS.Acceptance oAccept = new ActWS.Acceptance();
StreamReader streamReader = new StreamReader("c:\\temp\\Request.dat");
strXML = streamReader.ReadToEnd();
streamReader.Close();
Stopwatch stopWatch = new Stopwatch();
oRequest = new ActWS.Request();
oService = new ActWS.ServiceClient("BasicHttpBinding_IService1");
// To ignore BindingFailure, turn off Errors -> Managed Debugging Assitant -> BindingFailure
oResponse = new ActWS.Response();
strRetXML = oService.MakeRequest(strXML);
if (strRetXML == null)
{
Console.WriteLine("XML was invalid");
Environment.Exit(0);
}
클라이언트 및 서버 구성 (.config 파일 또는 사용하는 코드에 따라 다름)을 게시해야합니다. –
코드에 대한 코드 액세스 정책을 확인하십시오. 코드가 부분적으로 신뢰 된 것 같습니다. – Shailesh
요청에 따라 구성 파일을 포함하기 위해 원본 코멘트를 업데이트했습니다. Shailesh를하기 위해 필요한 링크가 있습니까? 사용자 세부 정보는 서버에서 정확하며 여기에 익명으로 표시됩니다. – MiscellaneousUser