IIS 5.1에서 호스팅하는 WCF 서비스에 대한 클라이언트를 만들려고합니다. 이상한 문제가 있습니다. 브라우저를 통해 서비스에 액세스 할 수 있습니다. 당신은 서비스 "페이지를 만들었습니다,하지만WCF 서비스 클라이언트 문제
svcutil.exe http://my.host.name/SampleService/SampleService.svc?wsdl
나는 다음과 같은 오류가 취득 (같은 페이지에 의해 제안) 내가는 svcutil를 실행하려고 할 때마다 :
Error: Cannot obtain Metadata from http://localhost.ms.com/SampleService/SampleS
ervice.svc?wsdl
If this is a Windows (R) Communication Foundation service to which you have acce
ss, please check that you have enabled metadata publishing at the specified addr
ess. For help enabling metadata publishing, please refer to the MSDN documentat
ion at http://go.microsoft.com/fwlink/?LinkId=65455.
WS-Metadata Exchange Error
URI: http://localhost.ms.com/SampleService/SampleService.svc?wsdl
Metadata contains a reference that cannot be resolved: 'http://localhost.ms.
com/SampleService/SampleService.svc?wsdl'.
The HTTP request is unauthorized with client authentication scheme 'Anonymou
s'. The authentication header received from the server was 'Negotiate'.
The remote server returned an error: (401) Unauthorized.
HTTP GET Error
URI: http://localhost.ms.com/SampleService/SampleService.svc?wsdl
There was an error downloading 'http://localhost.ms.com/SampleService/Sample
Service.svc?wsdl'.
The request failed with an empty response.
If you would like more help, type "svcutil /?"
이 문제의 원인이 될 수 무엇?
편집 : IIS 자체에서 문제가 될 수 있습니까? 예를 들어 사용 권한을 잘못 설정 했습니까?
편집 : 여기 내 Web.config의가있다 :
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="Basic">
<security mode="None"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="DummyService2.SampleService"
behaviorConfiguration="DummyService2.SampleServiceBehavior">
<!-- Service Endpoints -->
<endpoint address="" binding="basicHttpBinding" contract="DummyService2.ISampleService"
bindingConfiguration="Basic" />
<endpoint address="mex" binding="basicHttpBinding" contract="IMetadataExchange"
bindingConfiguration="Basic" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DummyService2.SampleServiceBehavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="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="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
web.config (또는 app.config) 파일을 게시하십시오. –