Click here to Skip to main content
15,923,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

I am very new to WCF.And I have created a sample WCF service(Created a console Application,Added ServiceModel.dll,Implemented ServiceContracts,OperationContracts).When I am running the application,I am getting the following exception.

[System.ServiceModel.AddressAccessDeniedException] {"HTTP could not register URL http://+:8888/Microsoft.ServiceModel.Samples/CalculatorService/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details)."} System.ServiceModel.AddressAccessDeniedException.

The following is the peice of code in Main()

ServiceHost selfHost = null;
Uri baseAddress = new Uri(http://localhost:8888/Microsoft.ServiceModel.Samples/CalculatorService);
selfHost= new ServiceHost(typeof(CalculatorService), baseAddress);
                selfHost.AddServiceEndpoint(typeof(ICalculator),new WSHttpBinding(),CalculatorService);
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
selfHost.Description.Behaviors.Add(smb);
selfHost.Open();
Console.WriteLine("The service is ready");
Console.ReadKey();

I am running it on XP OS.
Can any one please tell me how can I execute the service.

Thanks,
Srikrishna
Posted
Updated 22-Mar-10 6:17am
v2

Hi,

One of the probable reasons looks like your console process doesnt have the sufficient access rights.Hence i would suggest you to run your application with Administrator previledge it should work.

I hope this helps!.

Regards,
-Vinayak
 
Share this answer
 
Have you checked to see if something else is already listening on port 8888?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900