Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5943021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:20:08+00:00 2026-05-22T16:20:08+00:00

I have a RESTful service that doesn’t work. When I type the URI into

  • 0

I have a RESTful service that doesn’t work. When I type the URI into the address bar, I receive this error:

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /VirtualRUS/Service1.svc/

I can’t tell why its not working. I compared my code and web.config to a working example, and I can’t find any differences.

EDIT: Also, I’m able to use the service just fine if I use a service reference. It just doesn’t work if I navigate to the URI, or more importantly, when I try to make a WebRequest.

Does anyone have any idea why this wouldn’t work?

Service1.cs:

[ServiceContract]
public interface IService1
{
   [OperationContract]
   [WebGet(UriTemplate = "/")]
   string Test(); 
}

Service1.svc.cs:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
public class Service1 : IService1
{
   public string Test()
   {
      return "It works!!";
   }
}

Web.Config:

<?xml version="1.0" ?>
<configuration>
    <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
                </sectionGroup>
            </sectionGroup>
        </sectionGroup>
    </configSections>
    <appSettings></appSettings>
    <connectionStrings>
        <add name="ResearchLibrary" connectionString="Server=XXXXXX" ; Initial Catalog=ResearchLibrary; user id=XXX; password=XXX " />
     </connectionStrings>
     <system.web>
        <compilation debug="true ">
            <assemblies>
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089 "/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 "/>
            </assemblies>
        </compilation>
        
        <authentication mode="Windows "/>
        
        <pages>
            <controls>
                <add tagPrefix="asp " namespace="System.Web.UI " assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 "/>
            </controls>
        </pages>
        <httpHandlers>
            <remove verb="* " path="*.asmx "/>
            <add verb="* " path="*.asmx " validate="false " type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 "/>
            <add verb="* " path="*_AppService.axd " validate="false " type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 "/>
            <add verb="GET,HEAD " path="ScriptResource.axd " type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 " validate="false "/>
        </httpHandlers>
        <httpModules>
            <add name="ScriptModule " type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 "/>
        </httpModules>
      <httpRuntime maxRequestLength="65536 "/>
    </system.web>
    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp " extension=".cs " warningLevel="4 " type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ">
                <providerOption name="CompilerVersion " value="v3.5 "/>
                <providerOption name="WarnAsError " value="false "/>
            </compiler>
        </compilers>
    </system.codedom>
    <system.web.extensions>
        <scripting>
            <webServices>
            </webServices>
        </scripting>
    </system.web.extensions>
    
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false "/>
        <modules>
            <add name="ScriptModule " preCondition="integratedMode " type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 "/>
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated "/>
            <add name="ScriptHandlerFactory " verb="* " path="*.asmx " preCondition="integratedMode " type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 "/>
            <add name="ScriptHandlerFactoryAppServices " verb="* " path="*_AppService.axd " preCondition="integratedMode " type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 "/>
            <add name="ScriptResource " preCondition="integratedMode " verb="GET,HEAD " path="ScriptResource.axd " type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35 "/>
        </handlers>
    </system.webServer>
    <system.serviceModel>
        <services>
            <service name="ResearchUploadService.Service1 " behaviorConfiguration="ResearchUploadService.Service1Behavior ">
                <!-- Service Endpoints -->
                
            <endpoint address="customBinding " binding="customBinding " bindingConfiguration="basicConfig " contract="ResearchUploadService.IService1 "/>
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="ResearchUploadService.Service1Behavior ">
                    
                    <serviceMetadata httpGetEnabled="true "/>
                    <
                    <serviceDebug includeExceptionDetailInFaults="true "/>
                </behavior>
            </serviceBehaviors>
      </behaviors>
      <bindings>
         <customBinding>
            <binding name="basicConfig ">
               <binaryMessageEncoding/>
               <httpTransport transferMode="Streamed " maxReceivedMessageSize="67108864 "/>
            </binding>
         </customBinding>
      </bindings>
    </system.serviceModel>
</configuration>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:20:09+00:00Added an answer on May 22, 2026 at 4:20 pm

    Your endpoint isn’t a REST endpoint, it’s a “normal” SOAP endpoint (binary encoding / http transport). REST endpoints are defined with a specific binding (webHttpBinding) and behavior (webHttp). Also, Add Service Reference doesn’t work for REST endpoints, which is also an indication that if it works for you, then you’re not using a REST endpoint.

    To change your endpoint to be RESTful, you can change the web.config as shown below (it actually adds a REST endpoint in addition to the SOAP one which you already have).

    <system.serviceModel>
        <services>
            <service name="ResearchUploadService.Service1" behaviorConfiguration="ResearchUploadService.Service1Behavior">
                <!-- Service Endpoints -->
    
            <endpoint address="customBinding" binding="customBinding" bindingConfiguration="basicConfig" contract="ResearchUploadService.IService1"/>
            <endpoint address="" binding="webHttpBinding" behaviorConfiguration="REST" contract="ResearchUploadService.IService1"/>
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="ResearchUploadService.Service1Behavior">
    
                    <serviceMetadata httpGetEnabled="true"/>
                    <serviceDebug includeExceptionDetailInFaults="true"/>
                </behavior>
            </serviceBehaviors>
            <endpointBehaviors>
               <behavior name="REST">
                 <webHttp/>
               </behavior>
            </endpointBehaviors>
      </behaviors>
      <bindings>
         <customBinding>
            <binding name="basicConfig">
               <binaryMessageEncoding/>
               <httpTransport transferMode="Streamed" maxReceivedMessageSize="67108864"/>
            </binding>
         </customBinding>
    
      </bindings>
    </system.serviceModel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a RESTful service that I am developing in WCF . I am
Let's say I have a RESTful, hypertext-driven service that models an ice cream store.
I have a web service site that is restful enabled, so other websites/ajax script
Greetings: I have put together a RESTful web service in .NET 3.5 that takes
I have a WCF restful service that I'm trying to upload an image to.
I have a RESTful service which injects an EJB(3.0) using the @EJB annotation. This
I have successfully implemented a restful service that works with my own client. Now,
I have a RESTful web service running on Jersey (GlassFish 3.1.1). This one's a
I have a RESTful web service deployed at http://example.com/v1/SomeResource . One day, a new
I have a restful web service which can deal with DTOs in json format

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.