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 7754751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:23:28+00:00 2026-06-01T12:23:28+00:00

I have created a REST server under ASP.NET and I can’t figure out the

  • 0

I have created a REST server under ASP.NET and I can’t figure out the url to bring up the service. I am running under VS 2010 using it’s built in web server. I believe it is actually running (VS 2010 starts up fine). But every combination I can think of for a url doesn’t bring it up.

Update: Please take a look at the file http://www.windward.net/temp/RestUnderAspDotNet.zip – I have two solutions in there. The one at src\update runs fine as a REST server. I have pretty much the same code at inetpub\wwwroot\update and while it runs, I can’t find a url that talks to it. I tried every variation of http://localhost:56469/update/App_Code/RestServiceImpl.svc/test I could think of and get either 403 or 404.

Any idea why? (I do not want any security on this – anyone will be able to hit it once it’s up.)

App_Code\IRestServiceImpl.cs:

[ServiceContract]
public interface IRestServiceImpl
{
    [OperationContract]
    [WebInvoke(UriTemplate = "/version", Method = "POST")]
    XmlElement GetVersion(XmlElement stats);

    [OperationContract]
    [WebInvoke(UriTemplate = "/test", Method = "GET")]
    string GetTest();
}

App_Code\RestServiceImpl.svc:

<%@ ServiceHost Language="C#" Debug="true" Service="RestServiceImpl" CodeBehind="RestServiceImpl.svc.cs" %>

App_Code\RestServiceImpl.cs:

using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Xml;

[AspNetCompatibilityRequirements
    (RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
public class RestServiceImpl : IRestServiceImpl
{
    public XmlElement GetVersion(XmlElement stats)
    {
        XmlDocument doc = new XmlDocument();
        XmlElement root = doc.CreateElement("update");
        root.SetAttribute("version", "11.0.13.0");
        doc.AppendChild(root);
        return doc.DocumentElement;
    }

    public string GetTest()
    {
        return "update server is running";
    }
}

Relevant part of web.config:

<system.web>
    <compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
    <services>
        <service name="RestServiceImpl">
            <!-- Service Endpoints -->
            <!-- Unless fully qualified, address is relative to base address supplied above -->
            <endpoint address ="" binding="webHttpBinding" contract="IRestServiceImpl" behaviorConfiguration="webBinding">
            </endpoint>
        </service>
    </services>

    <behaviors>
        <endpointBehaviors>
            <behavior name="RestServiceImpl">
                <webHttp/>
            </behavior>
        </endpointBehaviors>
    </behaviors>
    <bindings>
        <webHttpBinding>
            <binding name="webBinding">
            </binding>
        </webHttpBinding>
    </bindings>
</system.serviceModel>
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

Any idea what the url is to bring up the /test GET?

thanks – dave

  • 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-06-01T12:23:29+00:00Added an answer on June 1, 2026 at 12:23 pm

    I finally figured this out. I have this also on my blog at Windward Wrocks with screenshots. Here’s the solution w/o screenshots:

    1. Install the WCF REST Service Template 40(CS) (requires .NET 4.0).
    2. Create a WCF service. This is a New “Project…” not a “Web Site…”. And it is under the general “Visual C#” templates, not “WCF”!
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a basic site using ASP.NET routing according to Mike Ormond's example
I am writing a server used ASP.NET Web Api template and implementing rest services.
I have successfully created a PHP REST API which resides on my server. I
I created a simple DataSnap REST server in Delphi XE2 and i have a
I have just created my first rest service using apicontroller. I am using it
I'm trying to create a very simple REST server. I just have a test
I have created a file with XmlDocument xmldoc = new XmlDocument(); Can I make
I have created a SQL Server 2005 matrix with a total column. I want
i have created a Java Restful Web service . Now i want to access
I have created a server program, and a certain error has occurred twice where

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.