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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:02:39+00:00 2026-06-15T12:02:39+00:00

Usually I see the code of WCF REST JSON is likely: // Start the

  • 0

Usually I see the code of WCF REST JSON is likely:

// Start the service and browse to <a href="http://:/SampleService/help[ServiceContract]  public">http://<machine_name>:<port>/SampleService/help [ServiceContract]
 public interface ISampleService {
[WebGet(UriTemplate = "")]
List<SampleItem> GetCollection();

That means interface is introduced. But in some occurence I saw in the code interface is never used at all.
Such as

 [ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class AlertService
{
    AlertContext alertProxy = new AlertContext();
    AlertDetailsContext alertDetailProxy = new AlertDetailsContext();
    Analytics analyticsProxy = new Analytics();

    [OperationContract]
    [WebInvoke(BodyStyle=WebMessageBodyStyle.Bare, RequestFormat=WebMessageFormat.Json, ResponseFormat=WebMessageFormat.Json, UriTemplate="/SearchAlerts")]
    public List<Alert> SearchAlerts(AlertFilter filter)
    {
        WebOperationContext.Current.OutgoingResponse.Headers.Add("Cache-Control", "no-cache, must-revalidate");
        WebOperationContext.Current.OutgoingResponse.Headers.Add("Expires", "Sat, 26 Jul 1997 05:00:00 GMT");

Here class is used directly, why?

  • 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-15T12:02:40+00:00Added an answer on June 15, 2026 at 12:02 pm

    Because the ServiceContract doesn’t have to be an interface contract. Using an interface allows you to share the same contract among multiple implementations and can make unit testing possible, but it is not required.

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

Sidebar

Related Questions

I've been using http://code.google.com/p/phpbrowscap/ for a project, and it usually works nice. But a
I usually see this when looking at Win32 gui code. My assumption is that
I'm following http://backreference.org/2010/03/26/tuntap-interface-tutorial/ The following code successfully gets a fd (usually 3) when I
i really need help, i can't see something that is obvious, and usually then
In Objective-C, I usually see methods that return a dynamically typed object defined as
When I study about cloud-computing, I usually see these terms: on-premise, off-premise applications. I
I usually like to declare my local variables as final but I see repeating
Usually, as my code base grows, the functions recieve more and more arguments and
A statement that could be written as: foo=(bar*5)+baz; is usually written in sample code
The issue was originally encountered on a WCF Data Service (OData) where a large

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.