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

  • Home
  • SEARCH
  • 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 7974993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:31:46+00:00 2026-06-04T08:31:46+00:00

I created website to host web service when run it raise runtime error The

  • 0

I created website to host web service when run it raise runtime error

The contract name ‘ITry’ could not be found in the list of contracts implemented by the service ‘Try’.

My WCF service interface and class look like that

namespace test1
{
   [ServiceContract]
   public interface ITry
   {
        [OperationContract]
        [WebInvoke(Method = "GET",
         ResponseFormat = WebMessageFormat.Json,
         UriTemplate = "data/{username}/{password}")]
        string Login(string username, string password);
    }
}

Service implementation:

namespace test1
{
    public class Try : ITry
    {
        public string Login(string username, string password)
        {
            using (var instance = new FacultySystemEntities1())
            {
                var user = instance.Users.Where(u => u.UserName == username && u.UserPassword == password).FirstOrDefault();

                if (user != null)
                    return "true";
                else
                    return "false";
            }
        }
    }
}

and the web site , web.config is look like

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
    <services>
      <service name="test1.Try">
        <endpoint address="http://localhost:8732/Try" binding="webHttpBinding" contract="ITry"/>
      </service>
    </services>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</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-06-04T08:31:46+00:00Added an answer on June 4, 2026 at 8:31 am

    Update the contract attribute from “ITry” to “test1.ITry” in the web.config.

    <services> 
      <service name="test1.Try"> 
        <endpoint address="http://localhost:8732/Try" binding="webHttpBinding" contract="test1.ITry"/> 
      </service> 
    </services> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a number of standard WCF Services (Service Contract and Host (svc) are
Simple. I created a LINQ-TO-SQL Entity model, created a website, added a Data Service
I have successfully created an ASP.net website to make calls to a Soap Web
I created simple Silverlight Application using the web site host of the VS2010 (
I've a Mac server which I'm using to host my website. I created a
I have created a website using IPB which I believe is written in PHP,
I have created a website using IPB which I believe is written in PHP.
I've created a website with ASP.NET MVC. I have a number of static pages
I have created a website using modx evolution v1.0.2. The website that I have
I have almost created a website that works in all major browsers flawlessly. Yesterday,

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.