2012-03-24 1 views
9

내 WCF 웹 기반 서비스 (wsHttp 및 netTcp)에 두 개의 끝점을 포함하려고합니다. 내가 그들을 추가,하지만 내 웹 브라우저에서 Service.svc에 내가 컴파일 할 때 때 다음과 같은 오류가 발생하고 클릭 한 아래 Web.config에 나타낸 바와 같이 :system.serviceModel/bindings/wsHttpBinding의 바인딩에 오류가 없습니다 ...

오류 페이지 :

Server Error in '/MyService' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: The binding at system.serviceModel/bindings/wsHttpBinding does not have a configured binding named 'wsHttpBinding'. This is an invalid value for bindingConfiguration. 

Source Error: 

Line 16: </baseAddresses> Line 17:   </host> Line 18: <endpoint address="http://localhost:8090/Services/MyService" Line 19:     binding="wsHttpBinding" Line 20:     bindingConfiguration="wsHttpBinding" 


Source File: C:\MyService\web.config Line: 18 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

웹 의 .config :

<?xml version="1.0"?> 
<configuration> 
    <system.web> 
    <compilation debug="false" targetFramework="4.0" /> 
    </system.web> 
    <system.serviceModel> 
    <protocolMapping> 
     <add scheme="http" binding="wsHttpBinding"/> 
    </protocolMapping> 
    <services> 
     <service 
     name="Microsoft.ServiceModel.Samples.MyService"> 
     <host> 
      <baseAddresses> 
      <add baseAddress="net.tcp://localhost:9001/"/> 
      </baseAddresses> 
     </host> 
     <endpoint address="http://localhost:8090/Services/MyService" 
        binding="wsHttpBinding" 
        bindingConfiguration="wsHttpBinding" 
        name="MyService_WsHttp" 
        contract="Microsoft.ServiceModel.Samples.IService" /> 
     <endpoint address="net.tcp://localhost:9000/Services/MyService" 
        binding="netTcpBinding" 
        bindingConfiguration="tcpBinding" 
        name="MyService_Tcp" 
        contract="Microsoft.ServiceModel.Samples.IService" />  
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- 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="false"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 

</configuration> 

답변

30

이 꺼내 :

01 여기에서

:

address="http://localhost:8090/Services/MyService" 
        binding="wsHttpBinding" 
        bindingConfiguration="wsHttpBinding" 
+1

T ... 목 ... 감사합니다! – Bob

+0

그것이 효과적이라면 응답으로 표시하십시오. 그 이유는 귀하가 '기본 제공'바인딩을 사용하고 있다면 ... 구성 변경을하지 않았기 때문입니다.이 속성은 다음을 의미합니다. 가리키다. – Chris

+0

wsHttpBinding을 사용하면 Contract가 DualHttpBinding을 사용해야한다고 말합니다. – Hari

관련 문제