Note that there are some explanatory texts on larger screens.

plurals
  1. POI'm having trouble launching my WCF service using a console application. What can be wrong?
    primarykey
    data
    text
    <p>Here's my code:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; using BankServiceClient.BankServiceReference; namespace BankServiceClient { class Program { static void Main(string[] args) { Uri baseAddress = new Uri("http://localhost:8000/Simple"); Type instanceType = typeof(BankServiceReference.BankClient); ServiceHost host = new ServiceHost(instanceType,baseAddress); using (host) { Type contractType = typeof(BankServiceReference.IBank); string relativeAddress = "BankService"; host.AddServiceEndpoint(contractType, new BasicHttpBinding(), relativeAddress); host.Open(); Console.WriteLine("Press &lt;ENTER&gt; to quit."); Console.ReadLine(); host.Close(); } /* * Consuming a WCF Service and using its method. */ //IBank proxy = new BankClient(); //double number = proxy.GetBalance(1234); //Console.WriteLine(number.ToString()); //Console.ReadLine(); } } } </code></pre> <p>First, a couple of questions:</p> <ol> <li><p>The 'baseAddress' attribute, what exactly <strong>is</strong> it? When I launched my service using the default F5 (no console application) the service launched on a random port on localHost. How can I write in an exact number and expect it to go there? Confused at this one.</p></li> <li><p>What <strong>is</strong> the relativeAddress attribute? It says BankService but what should I write in that attribute? Confused at this one as well.</p></li> </ol> <p>Here's the exact error message I get when I try to run this Console application:</p> <blockquote> <p>HTTP could not register URL <a href="http://+:8000/Simple/" rel="nofollow noreferrer">http://+:8000/Simple/</a>. Your process does not have access rights to this namespace (see <a href="http://go.microsoft.com/fwlink/?LinkId=70353" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=70353</a> for details).</p> </blockquote>
    singulars
    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.
    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