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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:00:03+00:00 2026-05-24T18:00:03+00:00

I am super new to MVC (in fact, this is my first assignment) So,

  • 0

I am super new to MVC (in fact, this is my first assignment)

So, I have a good webservice running, functional, on my local machine

http://www.codetrials.local/wcf/UserServices.svc?wsdl

and In my MVC application, I added a service reference as usual, and then in my Model.cs I am trying this:

 using (CodeTrials.UserServicesClient _client = new UserServicesClient())
  {
       UserWebsite = _client.GetUserWebsite(username);
  }

but when I try to run this, I always get the exception endpoint not found. I can access this from my (different) asp.net project and it works just fine, same code and everything. After some digging around I found this answer I modified my above code to:

  BasicHttpBinding binding = new BasicHttpBinding();
  EndpointAddress address = new EndpointAddress("http://www.codetrials.local/wcf/UserServices.svc");
 using (CodeTrials.UserServicesClient _client = new UserServicesClient(binding, address))
  {
       UserWebsite = _client.GetUserWebsite(username);
  }

but now, I get a new exception: There was no endpoint listening at http://www.codetrials.local/wcf/UserServices.svc?wsdl that could accept the message

So I am at my wits end.

I found a similar question but it’s not what I am looking for.

Can you please guide me to the right path?
what am I not doing right?
should I shift the consuming of webservice from Model to Controller?

Thanks.

EDIT – This is my config file system.serviceModel section. I just copy pasted it from the WCF client test gui tool into web.config since it was not being generated by visual studio.

<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IUserServices" closeTimeout="00:01:00"
        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
        maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
        messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
        useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
          maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None"
            realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<client>
  <endpoint address="http://www.codetrials.local/wcf/UserServices.svc/wcf/UserServices.svc"
      binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IUserServices"
      contract="IUserServices" name="BasicHttpBinding_IUserServices" />
</client>
</system.serviceModel>
  • 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-24T18:00:04+00:00Added an answer on May 24, 2026 at 6:00 pm

    Reposting from the comments since it turned out to be the answer. 🙂 Turned out that web.debug.config was overwriting the web.config in this case.

    Are you sure its in the right web.config then? VS should create it automatically when you add the service reference (it does for me at least). One gotcha is that a normal MVC app has two web.config files, there’s a second one inside the Views folder by default. Other then that, I’m not really sure whats going on.

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

Sidebar

Related Questions

Im super new to Jquery so this may be a quick one. I have
I'm super new to this language. I have the ability to check for the
I'm am super new at this, and this is my first time ever using
First off, I would like to make clear, that I am SUPER NEW TO
Here is the super simple code i have: HtmlDocument htmlDoc = new HtmlDocument(); htmlDoc.OptionWriteEmptyNodes
I'm pretty new to Java so sorry if this is super basic. Basically I
This is super strange. I used a portion of code for a new project
I'm super new to CakePHP so I have a feeling that I'm probably just
I'm new to PHP/MySQL and super-new to CodeIgniter.. I have information in many MySQL
I'm super new to programming and rails. I have a table of venues and

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.