에서 통화를 할 수. 그것의 app.config는 다음과 같이WCF 서비스 라이브러리 - 내가 netTcpBinding와 WCF 서비스 라이브러리가 콘솔 응용 프로그램
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="netTcp" maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000">
<readerQuotas maxDepth="500" maxStringContentLength="50000000" maxArrayLength="50000000" maxBytesPerRead="50000000" maxNameTableCharCount="50000000" />
<security mode="None"></security>
</binding>
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="ReportingComponentLibrary.TemplateServiceBehavior"
name="ReportingComponentLibrary.TemplateReportService">
<endpoint address="TemplateService" binding="netTcpBinding" bindingConfiguration="netTcp"
contract="ReportingComponentLibrary.ITemplateService"></endpoint>
<endpoint address="ReportService" binding="netTcpBinding" bindingConfiguration="netTcp"
contract="ReportingComponentLibrary.IReportService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" ></endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8001/TemplateReportService" />
<add baseAddress ="http://localhost:8080/TemplateReportService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ReportingComponentLibrary.TemplateServiceBehavior">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
내가 테스트 목적으로 콘솔 응용 프로그램에서 호출 할.
서비스 참조를 추가하거나 svcutil을 사용하여 프록시를 추가하여 전화 할 수 있음을 이해합니다.
그러나이 두 경우 모두에서, 내 서비스는 위 (나는 WCF 테스트 클라이언트를 사용)
콘솔 응용 프로그램에서 다른 내가 호출 할 수있는 방법 및 테스트 서비스 방법은 거기에 실행 할 필요가?
답장을 보내 주셔서 감사합니다. WCF Test Client를 사용하여 내 서비스를 실행하고 위의 두 가지 방법으로 작업 할 수 있습니다. 어떤 곳에서는 ServiceHost를 사용하는 예도 보았습니다. 콘솔 응용 프로그램에서 작동하는 방법을 잘 모르는 경우도 있습니다. – iniki
WCF Test Client는 에 대한 구성 설정을 취하지 않으므로 직접 사용할 수 없으며 모든 인스턴스화마다이를 변경해야합니다. 그래서 그것을 호스트하는 다른 방법을 찾고있었습니다. –
iniki