Note that there are some explanatory texts on larger screens.

plurals
  1. POFailed to map path whem configuring WCF REST service for IIS 7.5
    primarykey
    data
    text
    <p>I am having an issue building and deploying WCF Rest services with IIS 7.5. If I open Visual Studio 2010 and create a new project of type "WCF Service Application" and then publish that to IIS it works fine. However, when I try to specify a WebGet Property on the operation contract from the IService.cs interface I get an error.</p> <p>Interface (from IService.cs):</p> <pre><code>[ServiceContract] public interface IService { [OperationContract] [WebGet(UriTemplate = "hello/?n={name}")] Message SayHello(string name); } </code></pre> <p>Corresponding Method (from Service.svc):</p> <pre><code>public Message SayHello(string name) { return Message.CreateMessage(MessageVersion.None, "*", "Hello "+name+"!"); } </code></pre> <p>I try to publish this to an IIS application I created (http://localhost/rest/) under my root site (http://localhost/) and the publish works successfully, however when I attempt to visit any page from the browser I get the following error:</p> <pre><code>Failed to map the path '/rest'. </code></pre> <p>I also tried changing the UriTemplate to <code>[WebGet(UriTemplate = "rest/hello/?n={name}")]</code> and I get the same error.</p> <p>I am using the default configuration file from IIS:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;system.web&gt; &lt;compilation debug="true" targetFramework="4.0" /&gt; &lt;/system.web&gt; &lt;system.serviceModel&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior&gt; &lt;serviceMetadata httpGetEnabled="true"/&gt; &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt; &lt;/system.serviceModel&gt; &lt;system.webServer&gt; &lt;modules runAllManagedModulesForAllRequests="true"/&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre> <p>I should also mention that I am using an application pool for .NET 4.0.</p> <p>Please help as I am very puzzled by this.</p> <p>Thanks in advance!</p> <p>Jeffrey Kevin Pry</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.
    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