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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:46:42+00:00 2026-06-05T09:46:42+00:00

I have WCF library that I hosted , the login function work well, but

  • 0

I have WCF library that I hosted , the login function work well, but the second function ReturnCounter

the interface is :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.ServiceModel;
using System.ServiceModel.Web;

namespace PMAService
{
    [ServiceContract]
    public interface IPMA
    {
        [OperationContract]
        string Login(string username, string password);

        [OperationContract]
        List<usp_ReturnEncounter_Result> ReturnEncounter();



    }
}

and the code is

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Web;
using System.Security.Cryptography;
using System.Web.Security;

namespace PMAService
{
    public class PMA : IPMA
    {

        [WebInvoke(Method = "GET",
   ResponseFormat = WebMessageFormat.Json,
   UriTemplate = "LogIn/{username}/{password}")]
        public string Login(string username, string password)
        {
            if (Membership.ValidateUser(username, password))
                return "true";
            else
                return "false";
        }

        // Method to retrieve the Counter 
        [WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "ReturnEncounter")]
        public List<usp_ReturnEncounter_Result> ReturnEncounter()
        {
            using (PMAEntities context = new PMAEntities())
            {
              return   context.usp_ReturnEncounter().ToList();
            }
        }

    }
}

where I connect to Entity framework

the web.config look like

<?xml version="1.0"?>
<configuration>
  <appSettings/>
  <connectionStrings>
</connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
    <roleManager enabled="true" />
    <membership>
      <providers>
        <remove name="AspNetSqlMembershipProvider"/>
        <add name="AspNetSqlMembershipProvider"
             type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
             connectionStringName="Login"
             enablePasswordRetrieval="false"
             enablePasswordReset="true"
             requiresQuestionAndAnswer="false"
             applicationName="/"
             requiresUniqueEmail="false"
             passwordFormat="Hashed"
             maxInvalidPasswordAttempts="5"
             minRequiredPasswordLength="1"
             minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow="10"
             passwordStrengthRegularExpression="" />
      </providers>
    </membership>

    <authentication mode="Windows"/>
    <customErrors mode="On"/>
  </system.web>
  <system.serviceModel>
    <services>
      <service name="PMAService.PMA">
        <endpoint binding="webHttpBinding" contract="PMAService.IPMA" behaviorConfiguration="web">
        </endpoint>
      </service>
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior name="web">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>

the login/x/y work well, while ReturnCounter give the error endpoint not found

any idea to fix that please

  • 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-05T09:46:43+00:00Added an answer on June 5, 2026 at 9:46 am

    First of all enable Tracing on your Service and see what is the cause for exception.

    Also you would consider increasing ReaderQuotas on your server and client side so that larger data is passed without any problem. Sample shown below:

    <system.serviceModel>    
    <bindings>
    <webHttpBinding>
              <binding maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
                 <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
                      maxArrayLength="2147483647" maxBytesPerRead="2147483647"
                      maxNameTableCharCount="2147483647" />
                <security mode="None" />
              </binding>
            </webHttpBinding>
    </bindings>
    </system.serviceModel>   
     
    

    Also i see in your code that you are passing the object fetched by entity framework directly. There are situations where the entity framework objects dont get deserialzed and might cause exception. Create a simple POCO and then populate the fetched data and return the POCO.

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

Sidebar

Related Questions

I have a wcf service library that is hosted in a windows service. I
I have a WCF Service Library (implemented using NH) with one of the class
I have created a WCF service interface and implementation in a Class Library. I
We have a WCF service that we recently switched from self-hosting to IIS-hosted. It
I have a WCF Library Project that connects to SQL server and the connection
I currently have a wcf service library project that includes my service contract &
I have a .NET 3.5 WCF service hosted in IIS. The project service library
I have a WCF Web application that uses a WCF Class Library. My project
I'm using a class library that exposes a few objects. These objects have a
I have a WCF library project that I reference from a console app. The

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.