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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:08:21+00:00 2026-05-18T08:08:21+00:00

We’ve tried to use a very very simple WCF service with a HTTp Get

  • 0

We’ve tried to use a very very simple WCF service with a HTTp Get and we can’t get it work.
We’ve followed those “guide” but it doesn’t work

  • http://msdn.microsoft.com/en-us/library/bb412178.aspx
  • http://www.dotnetfunda.com/articles/article779-simple-5-steps-to-expose-wcf-services-using-rest-style-.aspx

When we call our service with the following url, we get a page not found error:

http://localhost:9999/Service1.svc/GetData/ABC

The base url (http://localhost:9999/Service1.svc) works fine and returns the wcf service information page correctly.

Those are the steps and code to reproduce our example.

  1. In Visual Studio 2010, create a new “WCF Service Application” Project
  2. Replace the IService interface with this code

      [ServiceContract()]
      public interface IService1
      {
          [OperationContract()]
          [WebInvoke(Method = "GET", 
                     BodyStyle = WebMessageBodyStyle.Bare, 
                     UriTemplate = "GetData/{value}")]
          string GetData(string value);
      }
    
  3. Replace the Service class with this code

    public class Service1 : IService1
    {
        public string GetData(string value)
        {
            return string.Format("You entered: {0}", value);
        }
    }
    
  4. The web.config look like this

    <system.web>
       <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
    </system.web>
    <system.serviceModel>
      <services>
          <service name="Service1">
              <endpoint address="" binding="webHttpBinding" contract="IService1" behaviorConfiguration="WebBehavior1">
              </endpoint>
          </service>
      </services>
      <behaviors>
          <endpointBehaviors>
              <behavior name="WebBehavior1">
                 <webHttp helpEnabled="True"/>
        </behavior>
    </endpointBehaviors>
    <serviceBehaviors>
    <behavior>
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
      </behavior>
    </serviceBehaviors>
    

  5. Press Run and try to call the Get method

If someone get this or something similar working, it would be very kind if you could reply information about the working example.

Thank you very much

  • 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-18T08:08:22+00:00Added an answer on May 18, 2026 at 8:08 am

    I recreated your sample – works like a charm.

    One point: do your service contract (public interface IService1) and service implementation (public class Service1 : IService1) exist inside a .NET namespace??

    If so, you need to change your *.svc and your web.config to include:

    <services>
          <service name="Namespace.Service1">
              <endpoint address="" binding="webHttpBinding" 
                        contract="Namespace.IService1" 
                        behaviorConfiguration="WebBehavior1">
              </endpoint>
          </service>
      </services>
    

    The <service name="..."> attribute and the <endpoint contract="..."> must include the .NET namespace for this to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put

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.