2013-02-06 2 views
2

WCF를 초보자입니다. IIS에 WCF를 배포하고 서비스를 사용하는 단계를 찾고 있습니다. IIS에서 웹 사이트를 배포하는 것과 동일한 단계를 수행하고 기본 문서를 Service1.svc로 설정하십시오.IIS 7.5에서 WCF 서비스 배포

이제이 wcf 서비스를 사용하려고 할 때 다음 오류가 발생합니다.

Metadata contains a reference that cannot be resolved: 'http://manish-pc:8000/Service1.svc?wsdl'. 
The WSDL document contains links that could not be resolved. 
There was an error downloading 'http://manish-pc:8000/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:8000/Service1.svc'. 
Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost:8000/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. 

follwing을

은 Web.Config 파일 내 서비스 상세

<system.serviceModel> 
    <services> 
     <service behaviorConfiguration="DemoWCF.Service1Behavior" name="DemoWCF.Service1"> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:8000/Service1.svc"/> 
      </baseAddresses> 
     </host> 
     <endpoint address="http://localhost:8000/Service1.svc" 
        binding="basicHttpBinding" 
        contract="DemoWCF.IService1" 
        bindingConfiguration="basicBinding"> 
      <identity> 
      <dns value="localhost"/> 
      </identity> 
     </endpoint> 
     <endpoint address="mex" 
        binding="mexHttpBinding" 
        contract="IMetadataExchange" /> 
     </service> 
    </services> 

    <bindings> 
     <basicHttpBinding> 
     <binding name="basicBinding" textEncoding="utf-8"></binding> 
     </basicHttpBinding> 
    </bindings> 

    <behaviors> 
     <serviceBehaviors> 
     <behavior name="DemoWCF.Service1Behavior"> 
      <serviceMetadata httpGetEnabled="True" /> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 

내가 부족하고있어 어떤 단계를 만들기 위해 어디 나를 인도 해주십시오이다. 감사합니다. .

답변

5

Google에서 검색하고 비디오를 본 후. 마침내 나는 해결책을 얻었다.

이 오류는 IIS 구성으로 인해 발생했습니다.

  1. IIS 관리자 콘솔을 엽니 다.
  2. 별도의 응용 프로그램 풀을 만듭니다.
    a). .NET Framework 버전을 4.0으로 설정하십시오.
    b). 관리 파이프 라인 모드 : 클래식
  3. 응용 프로그램 풀 ID를 "LocalSystem"으로 설정합니다.
  4. 가상 디렉터리 만들기와 마찬가지로 IIS에서 웹 응용 프로그램을 배포하는 단계와 동일합니다.
  5. 작성한 응용 프로그램 풀을 가상 디렉터리 세트로 만듭니다.

그리고 클라이언트 응용 프로그램에서 WCF 서비스를 사용하십시오. 이에 대한 자세한 내용을 발견하면

Click here to watch the video

친절이 질문/답변 스레드를 업데이트합니다.
감사합니다 :)

+2

전체 적용 풀을 "LocalSystem"으로 실행시키는 것은 상당한 보안 위험입니다. –