2011-04-05 4 views
1

"Whats new in WCF4.0"자습서를 진행하십시오. 첫 번째 연습은 설정없이 서비스를 설정하는 것입니다. 그런 다음 서비스 메타 데이터를 제공하기 위해 일부 구성을 배치합니다. 간단한 물건. 이건 내 설정이다 http://localhost:9001/testWCF 끝점 구성

이 경우 ...

<system.serviceModel> 
    <behaviors> 
     <serviceBehaviors> 
      <behavior name="WCF4Configuration.EchoServiceBehavior"> 
       <serviceMetadata httpGetEnabled="true" /> 
       <serviceDebug includeExceptionDetailInFaults="false" /> 
      </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <services> 
     <service behaviorConfiguration="WCF4Configuration.EchoServiceBehavior" name="WCF4Configuration.EchoService"> 
      <endpoint address="" binding="wsHttpBinding" contract="WCF4Configuration.IEchoService"> 
       <identity> 
        <dns value="localhost" /> 
       </identity> 
      </endpoint>        
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
      <endpoint address="http://localhost:9001/test" binding="wsHttpBinding" contract="WCF4Configuration.IEchoService"/> 
     </service> 
    </services> 
</system.serviceModel> 

그러나 - 지금 할 노력했다 무엇

다른 포트에서 동일한 서비스 계약을 노출 설정을 확장하는 것입니다 이 컴퓨터에 연결을 적극적으로 거부했다는 메시지가 표시됩니다. 왜이 기능이 작동하지 않습니까? 그리고 wcftestclient에서 서비스를 표시하기 위해 사용할 수있는 주소는 무엇입니까?

답변

0

시도 :

<services> 
     <service behaviorConfiguration="WCF4Configuration.EchoServiceBehavior" name="WCF4Configuration.EchoService"> 
      <endpoint address="" binding="wsHttpBinding" contract="WCF4Configuration.IEchoService"> 
       <identity> 
        <dns value="localhost" /> 
       </identity> 
      </endpoint>        
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
      <endpoint address="" binding="wsHttpBinding" contract="WCF4Configuration.IEchoService"> 
      <host> 
      <baseAddresses> 
       <add baseAddress="http://localhost:9001/test/" /> 
      </baseAddresses> 
      </endpoint> 
     </service> 
</services>