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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:41:58+00:00 2026-06-03T05:41:58+00:00

Hi I am using WCF Rest in my app with a layered architecture. My

  • 0

Hi I am using WCF Rest in my app with a layered architecture. My dataflow heirarchy is given below:

Data Layer -> Linq2Sql
||
Business Layer
||
WCF Rest Service
||
ASPX Pages

I am using JSON via JQuery to Select/Delete and codebehind to Insert/Update so as I can pass .Net objects to database base through my business layer(to check if i have business logic for them.) using WCF servive.

Forexample , I am ciphering password and deciphering password in my business layer and sending it to datalayer.Anyways, thats not the Issue. The issue is with WCF service configurationsettings. Every time i am getting unique exceptions like:

  1. 404 bad request.
  2. There was no endpoint listening at http://localhost/Service.svc that could accept the message.
  3. Could not find default endpoint element that references contract ‘xxx’ in the service model client configuaration section. This might be because no configuaration file was found for your application or because no end point element matching this contract could be found in the client element
    and so on….

What I tried is

  1. As per answer suggested by Tom Haigh.
    protected Save_Click(sender,e)
    {

    var user = new User
    {
    Login = login.Value,
    Password = pwd.Value,
    RealName = realname.Value,
    AccessRight = accessrights.Value,
    CustomAccesRight = customaccessrights.Value
    };

        var remoteAddress = new EndpointAddress("http://localhost:2360/UserService.svc");
    
        using (var client = new UserServiceClient(new BasicHttpBinding(), remoteAddress))
        {
            //set timeout
            client.Endpoint.Binding.SendTimeout = new TimeSpan(0, 0, 0, 10000);
    
            //call ws method
            client.Insert(user);
        } //using
    

}

  1. I removed using an tried also, got Error 400

    protected Save_Click(sender,e)
    {

    var user = new User
    {
    Login = login.Value,
    Password = pwd.Value,
    RealName = realname.Value,
    AccessRight = accessrights.Value,
    CustomAccesRight = customaccessrights.Value
    };

        var remoteAddress = new EndpointAddress("http://localhost:2360/UserService.svc");
    
       var client = new UserServiceClient(new BasicHttpBinding(), remoteAddress);
    
            //set timeout
            client.Endpoint.Binding.SendTimeout = new TimeSpan(0, 0, 0, 10000);
    
            //call ws method
            client.Insert(user);
    

}

My Config file of Service:

<system.serviceModel>
    <services>
      <service name="EnergyManagementControl.WcfSvc.UserService"  behaviorConfiguration="ServiceBehaviour" >
        <endpoint name="" binding="webHttpBinding"   contract="EnergyManagementControl.WcfSvc.IUserService" address="http://localhost:2360/UserService.Svc"   behaviorConfiguration="web"></endpoint>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehaviour"  >
          <serviceMetadata  httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="web">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>

My Config file of Client

<system.serviceModel>
    <client>
      <endpoint
        name = "Receptor"
         address="http://localhost:2360/UserService.Svc" 
        binding = "wsHttpBinding"
        contract="IUserService"
    />
    </client>
  </system.serviceModel>

But nothing seems to help. I know its config error ,please help me. Also any brief reference on WCF rest based on my scenario will be great help…..

Please not the WCF is created as a WCF Service Application and is a project in my Solution with my Web app. See image below: enter image description here

Also I am getting error on WebDev Server,not on IIS or Cassini

  • 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-03T05:41:59+00:00Added an answer on June 3, 2026 at 5:41 am

    I can’t speak much to WCF usage for REST services, but your service & client endpoint bindings do not match. WCF uses the binding to find a matching endpoint.

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

Sidebar

Related Questions

HI How do i add data using wcf rest architecture. I dont want to
I created a WCF rest service, then called that from javascript using ajax. Now
I am using WCF REST Start kit to build a RESTFul service. I defined
I'm new to REST and I'm building a service using the WCF REST Starter
I'm using WCF to create the REST backend for an app using backbone. WCF
I'm using WCF Web API to create a self-hosted/InProcess REST Service (HttpServiceHost) that the
I have the WCF REST Service target to .NET Framework 4. I am using
I am using WCF REST Service (4.0) to expose JSON API ..but not getting
I'm using the WCF Rest service application project template in visual studio. I'm just
I have a .Net server app (holding WCF REST JSONP service) and a javascript

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.