2011-04-29 4 views
1

WCF 서비스를 만들고 있습니다. 그것은 나의 첫 번째 것입니다. 오류가 나타납니다.WCF 기본 끝점을 찾을 수 없음

Could not find default endpoint element that references contract 'WCFClient.IWCFClient' in the ServiceModel client configuration section.

끝점 이름 등을 전환하고 서비스 참조를 삭제/재 작성하려고했습니다. 나는 그 문제가 무엇인지 알아낼 수 없다.

응용 프로그램 구성 :

<bindings> 
    <basicHttpBinding> 
     <binding name="BasicHttpBinding_IWCFClient" 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:4295/Services/WCFClient.svc" 
      binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWCFClient" 
      contract="WCFClient.IWCFClient" name="BasicHttpBinding_IWCFClient" /> 
    </client> 

서비스 구성은 :

<services> 
    <service behaviorConfiguration="WCFGraphicManagementTool.Services.WCFClientBehavior" 
    name="WCFGraphicManagementTool.Services.WCFClient"> 
     <endpoint address="" name="BasicHttpBinding_IWCFClient" binding="basicHttpBinding" contract="WCFGraphicManagementTool.Contracts.IWCFClient"> 
    </endpoint> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="WCFGraphicManagementTool.Services.WCFClientBehavior"> 
     <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
     <serviceThrottling maxConcurrentCalls="120" maxConcurrentSessions="120" maxConcurrentInstances="120" /> 
     <serviceMetadata httpGetEnabled="True" /> 
     <serviceDebug includeExceptionDetailInFaults="True" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors>  
+0

어떻게 클라이언트 프록시를 만드나요? –

+0

이게 무슨 뜻입니까? –

+0

WCFClient.WCFClientClient WCFClient = new WCFClient.WCFClientClient(); 이것은 오류가 발생한 행입니다. –

답변

1

난 그냥 그것을 알아 냈 :

이 같은이어야한다. 프로젝트의 web.config에도 추가해야했습니다. 서비스에 있었지만 프로젝트에는 없었습니다.

0

이는 설정 파일과 하나의 계약 이름에 지정된 서비스 이름/이름 공간 사이의 불일치에 일반적입니다 서비스 파일의 소스 코드 또는 마크 업. 일반적으로 Visual Studio를 통해 새 서비스를 만든 다음 서비스/네임 스페이스의 이름을 바꾼 후에 발생합니다.

솔루션 탐색기에서 SVC는 파일을 마우스 오른쪽 버튼으로 클릭하고 '서비스'속성 값이 맞다면 '보기 마크 업'

확인을 선택합니다. 네임 스페이스와 이름이 모두 할당 된 이름과 일치하는지 확인하십시오.

<%@ ServiceHost Language="C#" Debug="true" Service="WCFGraphicManagementTool.Services.WCFClient" CodeBehind="WCFClient.svc.cs" %> 
관련 문제