I do have this WCF service contract:
[ServiceContract]
public interface IPolicyRetriever
{
[OperationContract, WebGet(UriTemplate = "/clientaccesspolicy.xml")]
Stream GetSilverlightPolicy();
}
with this Web.config
section:
<service behaviorConfiguration="policyRetrieverServiceBehavior"
name="WebService.PolicyRetriever">
<endpoint address="" binding="webHttpBinding"
behaviorConfiguration="policyRetrieverEndpointBehavior"
contract="WebService.IPolicyRetriever" />
</service>
The server is running on localhost
, with Visual Studio web hosting, on port 8080
and the web service file is named WebService.svc
.
The above code will make the GetSilverlightPolicy()
method be exposed on http://localhost:8080/WebService.svc/clientaccesspolicy.xml
.
What I need is to expose the file on the root of the webserver instead of the WebService.svc
sub-path, but I could not find a way to accomplish this.
Setting the endpoint address
property to /
or http://localhost:8080/
did not work.
Neither adding a host
section to the service node:
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/"/>
</baseAddresses>
</host>
Did anyone find a solution?