2011-09-13 6 views
2

저는 wcf를 처음 사용합니다. iis 7.5에서 간단한 wcf 서비스를 만들었고 자습서를 사용하여 http://debugmode.net/2010/09/07/walkthrough-on-creating-wcf-4-0-service-and-hosting-in-iis-7-5/IIS7.5에서 WCF 서비스 호스팅

이 서비스를 사용하려고 할 때까지 모두 잘됩니다. 난 내 클라이언트에 서비스 참조를 추가 할 때 내 서비스의 Web.config를 포함

Metadata contains a reference that cannot be resolved: 'http://localhost:4567/Service1.svc?wsdl'. The WSDL document contains links that could not be resolved. There was an error downloading 'http://localhost:4567/Service1.svc?xsd=xsd0'. The underlying connection was closed: An unexpected error occurred on a receive. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. An existing connection was forcibly closed by the remote host Metadata contains a reference that cannot be resolved: 'http://localhost:4567/Service1.svc'. Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost:4567/Service1.svc . The client and service bindings may be mismatched. The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'. If the service is defined in the current solution, try building the solution and adding the service reference again.

다음과 같은 오류를 제공

<?xml version="1.0"?> 
<configuration> 

<system.web> 
    <compilation debug="true" targetFramework="4.0" /> 
</system.web> 
<system.serviceModel> 
    <behaviors> 
    <serviceBehaviors> 
     <behavior> 

     <serviceMetadata httpGetEnabled="true"/> 

     <serviceDebug includeExceptionDetailInFaults="false"/> 
     </behavior> 
    </serviceBehaviors> 
</behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
</system.serviceModel> 
<system.webServer> 
<modules runAllManagedModulesForAllRequests="true"/> 
</system.webServer> 

+0

클라이언트 측에서 wcf 구성은 무엇입니까? –

+0

클라이언트 측에 wcf 구성이 없습니다. 클라이언트에서 내가 m jux 서비스 참조를 추가하려고하면 – yrahman

답변

4

이 일반적 예외의 존재에 의한 일반 오류입니다 서비스에 의해 던졌습니다. 안타깝게도 includeExceptionDetailInFaults이 설정에서 false로 설정되어 있기 때문에 서비스를 사용하는 클라이언트에서 비누 예외 세부 정보를 볼 수 없습니다.

먼저 개발 환경에 includeExceptionDetailInFaults = "true"을 설정하여 예외 세부 사항이 추가로 표시 될 수 있습니다. 그런 다음 브라우저를 사용하여 http://localhost:4567/Service1.svc으로 직접 이동하여 일반 서비스 페이지가 표시되는지 확인하십시오. 그런 다음 http://localhost:4567/Service1.svc?wsdl으로 이동하여 WSDL이 적절하게 표시되는지 확인하십시오. 두 가지 상황에서 서비스에서 던져지는 모든 오류는 브라우저에 전달되어야합니다. 바라기를 원하면 문제의 근본 원인을 찾을 수 있습니다. 그래도 문제를 파악할 수 없다면 추가 정보를 게시하십시오. 행운을 빕니다!

+0

나는 ur ur 설명한 두 브라우저에서 브라우저에 액세스 할 시도하고 브라우저에서 제대로 작동합니다. web.config에서 includeExceptionDetailInFaults를 true로 변경했습니다. 및 재발행 된 서비스 및 참조를 클라이언트에 추가하려고 시도하지만 추가 세부 사항없이 정확히 동일한 오류를 제공합니다. – yrahman

+1

다음 단계는 xsd에 오류를 던지려고 시도하는 것입니다. 브라우저에서 http : // localhost : 4567/Service1.svc? xsd = xsd0로 이동하여 오류가 있는지 확인하십시오. – Capps