Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd service reference when using netTcp binding
    text
    copied!<p>I have a WCF service that I <strong>tested</strong> by copying its interfaces to a sample client project.<br> Now I want to work properly by adding a service reference.<br> The service is hosted in windows hosting (using <code>installUtil</code>).<br> The service has 2 projects - externals (interfaces + datacontracts) and internals (implementations).<br> For some reason it didn't have an app.config so I added one manually: </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;system.serviceModel&gt; &lt;services&gt; &lt;service name="ExecutionService" behaviorConfiguration="Default"&gt; &lt;endpoint name="TCPEndpoint" address="" binding ="netTcpBinding" contract="Externals.IExecutionService"/&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="net.tcp://localhost:3040/ExecutionService"/&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="Default"&gt; &lt;serviceMetadata httpGetEnabled="true"/&gt; &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;/system.serviceModel&gt; &lt;/configuration&gt; </code></pre> <p>Trying to add a service reference from my sample client causes the following error:</p> <pre><code>Metadata contains a reference that cannot be resolved: 'net.tcp://localhost:3040/ExecutionService/Externals.IExecutionService'. There was no endpoint listening at net.tcp://localhost:3040/ExecutionService/Externals.IExecutionService that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. If the service is defined in the current solution, try building the solution and adding the service reference again. </code></pre> <p>I saw <a href="https://stackoverflow.com/questions/9581881/creating-wcf-service-without-svc-file">here</a> that there's no need in app.config.<br> I'm a bit confused and I'm a beginner with <code>WCF</code>.<br> How can a nice <code>WPF</code> app reference my service? I want the service to be windows hosted and I don't want to drag dlls with me. </p> <p><strong>Edit</strong><br> I added a metadata endpoint and my appconfig now looks like this: </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;system.serviceModel&gt; &lt;services&gt; &lt;service name="ExecutionService" behaviorConfiguration="Default"&gt; &lt;endpoint name="TCPEndpoint" address="" binding ="netTcpBinding" contract="Externals.IExecutionService"/&gt; &lt;endpoint address="mex" binding="maxHttpBinding" contract="Externals.IExecutionService"/&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="net.tcp://localhost:3040/ExecutionService"/&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="Default"&gt; &lt;serviceMetadata httpGetEnabled="true"/&gt; &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;/system.serviceModel&gt; &lt;/configuration&gt; </code></pre> <p>I tried adding a service reference by using <code>net.tcp://localhost:3040/ExecutionService</code>, <code>net.tcp://localhost:3040/ExecutionService/Externals</code> and <code>net.tcp://localhost:3040/ExecutionService/Externals/IExecutionService</code> and I'm still getting the same error.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload