WCF/WF - WCF Service Host in Windows Service - Asked By siva on 27-Dec-10 08:04 AM

I create WCF service library and i test that working fine on WCF Test client(default). when i host the WCF service in winodws service that time i got the error. I am using windows XP sp3, .Net 3.5 and Visual Studio 2008. i got error.

Error opening host : HTTP could not register URL "http://+:8731/WCFServerDLL/Service1/." Your process does not have access rights to this namespace (see "http://go.microsoft.com/fwlink/?LinkId=70353" for details).

the above link for microsoft i implement the httpcfg.
Here i run the "httpcfg.exe set urlacl /u http://localhost:8000/WCFServerDLL/Service1/ /a"

i get the result

HttpSetServiceConfiguration completed with 0.
what is the problem i got same error. can you give me a suggation.

Venkat K replied to siva on 27-Dec-10 09:23 AM
Use the httpcfg.exe set urlacl command to change namespace reservations,
Check this link on how to proceed:
http://msdn.microsoft.com/en-us/library/ms733768.aspx

Thanks
siva replied to Venkat K on 28-Dec-10 03:09 AM
hi venkat,
 I tryed above you see that i get the result
"HttpSetServiceConfiguration completed with 0."
and also to check the "httpcfg query urlacl" the url is present, but again the same error i get it.
I give my App.config file here

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<system.web>

<compilation debug="true" />

</system.web>

<system.diagnostics>

<sources>

<source name="System.ServiceModel.MessageLogging">

<listeners>

<add name="messages"

type="System.Diagnostics.XmlWriterTraceListener"

initializeData="c:\logs\messages.svclog" />

</listeners>

</source>

</sources>

</system.diagnostics>

<!-- When deploying the service library project, the content of the config file must be added to the host's

app.config file. System.Configuration does not support config files for libraries. -->

<system.serviceModel>

<services>

<service name="WCFServerDLL.Service1" behaviorConfiguration="WCFServerDLL.Service1Behavior">

<host>

<baseAddresses>

<add baseAddress="http://localhost:8731/WCFServerDLL/Service1/" />

</baseAddresses>

</host>

<endpoint address="mex" binding="mexHttpBinding" name="MexHttp"

contract="IMetadataExchange" />

<endpoint address=""

binding="wsDualHttpBinding" contract="WCFServerDLL.IService1" />

</service>

</services>

<behaviors>

<serviceBehaviors>

<behavior name="WCFServerDLL.Service1Behavior">

<!-- To avoid disclosing metadata information,

set the value below to false and remove the metadata endpoint above before deployment -->

<serviceMetadata httpGetEnabled="True"/>

<!-- To receive exception details in faults for debugging purposes,

set the value below to true. Set to false before deployment

to avoid disclosing exception information -->

<serviceDebug includeExceptionDetailInFaults="False" />

</behavior>

</serviceBehaviors>

</behaviors>

<diagnostics>

<messageLogging

logEntireMessage="true"

logMalformedMessages="false"

logMessagesAtServiceLevel="true"

logMessagesAtTransportLevel="false"

maxMessagesToLog="3000"

maxSizeOfMessageToLog="2000"/>

</diagnostics>

</system.serviceModel>

</configuration>

Greg replied to siva on 19-Jan-11 03:25 PM
Are you intending to use localhost, or your computers actual network address?