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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:29:25+00:00 2026-05-24T03:29:25+00:00

This has probably been discussed however all the threads I saw on this topic

  • 0

This has probably been discussed however all the threads I saw on this topic did not help me hence I’m posting.

I am attempting to host a WCF HTTP service on IIS 5.1. It is extremely basic. I created a virtual directory in IE called wcftest, which points to the actual folder containing the contents of the service. Here is the structure:

Web.config
ConsoleWCF.svc
[App_Code] \ Program.cs

Here is the code for ConsoleWCF.svc

<%@ ServiceHost Debug="true" Service="ConsoleWCF.WCFImplementer" Language="C#" %>

The Web.config looks like this:

<configuration>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service name="ConsoleWCF.WCFImplementer" 
               behaviorConfiguration="ServiceBehavior">
        <endpoint 
            address="" 
            binding="basicHttpBinding" 
            contract="ConsoleWCF.WCFInterface" />
        <endpoint 
            address="mex" 
            binding="mexHttpBinding" 
            contract="IMetadataExchange" />
      </service>
    </services>
  </system.serviceModel>
</configuration>

And finally the Program.cs is:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ServiceModel.Description;

namespace ConsoleWCF
{
    [ServiceContract]
    public interface WCFInterface
    {
        [OperationContract]
        [WebGet]
        string GetData();
    }

    public class WCFImplementer : WCFInterface
    {
        public string GetData()
        {
            return "Tested Console WCF";
        }
    }
}

I can access this in IE by browsing to http://localhost/wcftest/ConsoleWCF.svc.

However I do not understand how to access the GetData method I have. When I did this using a stand-alone host, I had no issues accessing it. Any help is greatly appreciated.

  • 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-24T03:29:26+00:00Added an answer on May 24, 2026 at 3:29 am

    In order for WCF to understand the [WebGet] attribute, the endpoint needs to have a certain configuration, namely use the webHttpBinding (not basicHttpBinding as you do) and to have a WebHttpBehavior added to it. If you change the web.config to something like the one below, you should be able to browse to http://localhost/wcftest/ConsoleWCF.svc/GetData.

    <system.serviceModel>
      <behaviors>
        <endpointBehaviors>
          <behavior name="REST">
            <webHttp/>
          </behavior>
        </endpointBehaviors>
      </behaviors>
      <services>
        <service name="ConsoleWCF.WCFImplementer">
          <endpoint address=""
                    behaviorConfiguration="REST"
                    binding="webHttpBinding"
                    contract="ConsoleWCF.WCFInterface" />
        </service>
      </services>
    </system.serviceModel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This subject has probably been discussed hundreds of times. I'm not trying to claim
This problem probably has been discussed, but this one is slightly different. I'm using
This probably has been asked before but all I can find are questions regarding
I know this topic has been discussed a lot , but I have a
This has probably been asked a thousand times... But i'm sure i have all
This question has probably been the most covered question in all of DotNetNuke's lifetime
I know this has probably been addressed, however, I am having memory leak issues
I think this has probably been asked, but after reading a lot, I'm not
This has probably been answer already but I am trying to return the primary
This probably has a simple answer, but I must not have had enough coffee

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.