Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF Service 404 error
    primarykey
    data
    text
    <p>I am trying to set up a WCF Service but I'm having a few problems. The service works and loads the wsdl page when I type in </p> <pre><code>www.mydomain.com/Service1.svc </code></pre> <p>However when I use </p> <pre><code>www.mydomain.com/Service1.svc/ </code></pre> <p>or try to use any of the get methods I get </p> <pre><code>The resource cannot be found. Description: HTTP 404. </code></pre> <p>My web.config file is as follows</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;system.webServer&gt; &lt;handlers&gt; &lt;remove name="PageHandlerFactory-ISAPI-4.0"/&gt; &lt;add name="PageHandlerFactory-ISAPI-4.0" path="*" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /&gt; &lt;remove name="ASP.NET-ISAPI-4.0-Wildcard"/&gt; &lt;add name="ASP.NET-ISAPI-4.0-Wildcard" path="*" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /&gt; &lt;remove name="svc-Integrated-4.0" /&gt; &lt;add name="svc-Integrated-4.0" path="*" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" /&gt; &lt;/handlers&gt; &lt;validation validateIntegratedModeConfiguration="false"/&gt; &lt;/system.webServer&gt; &lt;system.web&gt; &lt;customErrors mode="Off"/&gt; &lt;compilation debug="true" targetFramework="4.0"&gt; &lt;/compilation&gt; &lt;httpHandlers&gt; &lt;remove verb="*" path="*.svc"/&gt; &lt;add path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" /&gt; &lt;/httpHandlers&gt; &lt;/system.web&gt; &lt;system.serviceModel&gt; &lt;services&gt; &lt;service name="RestService.Service1" behaviorConfiguration="ServiceBehaviour" &gt; &lt;endpoint address="" binding="webHttpBinding" contract="RestService.IService1" behaviorConfiguration="web"&gt; &lt;/endpoint&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="http://mydomain.com/Service1"/&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="ServiceBehaviour" &gt; &lt;serviceMetadata httpGetEnabled="true"/&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior name="web"&gt; &lt;webHttp/&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&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>The Service.svc file is as follows :</p> <pre><code>namespace RestService { public class Service1 : IService1 { public bool LoginUser( string Username, string password ) { return true; } } } </code></pre> <p>and the IService.cs is as follows:</p> <pre><code>namespace RestService { [ServiceContract] public interface IService1 { [OperationContract] [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, //BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "login/{username}/{password}")] bool LoginUser(string username, string password); } } </code></pre> <p>The pipeline mode on the server is "Integrated" if that helps. I'm not sure what IIS version my hosting provider (pipeten) uses but I think it's 7.5 I have a feeling this has something to do with the URL validation however there is no option on my hosting to change this.</p>
    singulars
    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