WCF Service Library - make calls from Console App

Posted by inutan on Stack Overflow See other posts from Stack Overflow or by inutan
Published on 2009-11-12T10:46:15Z Indexed on 2010/04/01 16:03 UTC
Read the original article Hit count: 328

Filed under:
|
|

Hello there,

I have a WCF Service Library with netTcpBinding. Its app.config as follows:

<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>

I want to call it from a console application for testing purpose.
I understand that I can call by adding Service Reference or by adding proxy using svcutil.
But in both these cases, my service needs to be up and running (I used WCF Test Client)

Is there any other way I can call and test service method from console application?

© Stack Overflow or respective owner

Related posts about wcf

Related posts about service