Note that there are some explanatory texts on larger screens.

plurals
  1. POC# / WCF: Populate and Consume ServiceInterface through Metadata Endpoint
    primarykey
    data
    text
    <p>I got a service which offers a named pipe as connection point/endpoint address for 3rd party applications.</p> <p>what i did so far is:</p> <pre><code>Uri[] baseAddress = new Uri[]{ new Uri("net.pipe://localhost")}; string PipeName = "Calculator"; serviceHost = new ServiceHost(typeof(CalculatorImplementation), baseAddress); // Add a mex endpoint ServiceMetadataBehavior smb = new ServiceMetadataBehavior(); smb.HttpGetEnabled = true; smb.HttpGetUrl = new Uri("http://localhost:8001/CalculatorServer"); serviceHost.Description.Behaviors.Add(smb); serviceHost.AddServiceEndpoint(typeof(ICalculator), new NetNamedPipeBinding(), PipeName); serviceHost.Open(); </code></pre> <p>I'm connecting in my client using a ChannelFactory like this:</p> <pre><code>ChannelFactory&lt;ICalculator&gt; pipeFactory = new ChannelFactory&lt;ICalculator&gt;(new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/Calculator")); ICalculator pipeProxy = pipeFactory.CreateChannel(); </code></pre> <p>But acutally I wonder if there is a more "usual" way to connect to the service. Does I really need to tell every 3rd party app the "connection string"/Endpoint Address of my named pipe ("net.pipe://localhost/Calculator") ?</p> <p>I thought that there might be a better way to accomplish this, but I did not found a way to do this so far. </p> <p>I created already that "mex endpoint" but I'm not sure how to use this endpoint to populate the named pipe. </p> <p>My questions are: I'm populating the service interface the right way? and How do I use the Metadata Endpoint in a client application right?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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