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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:48:25+00:00 2026-06-15T14:48:25+00:00

I use an Entity Framework (edmx file) for my model, and I’m using WCF

  • 0

I use an Entity Framework (edmx file) for my model, and I’m using WCF to access my model.
When try to return list of an entity data model (example table object), i get an error:

The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

Here is my WCF code. IService.cs:

[ServiceContract(CallbackContract = typeof(IPesananCallBack), SessionMode = SessionMode.Required)]
public interface IPelayanWebService
{
   [OperationContract]
   List<table> GetAllTables();
}

Service.cs:

public List<table> GetAllTables()
{
    TableModel model = new TableModel();
    return model.GetAllTables();
}

My code in model:

public List<table> GetAllTables()
{
    using (restoicdbEntities ent = new restoicdbEntities())
    {
        return ent.table.ToList();
    }
}

in my client, I just call that function, and the error occured.
Do I have to create my own data contract? Is there anyway to generate the datacontract from the edmx?

Update:
This is the generated code from Entity Framework:

[EdmEntityTypeAttribute(NamespaceName="restoicdbModel", Name="table")]
[Serializable]
[DataContractAttribute(IsReference=true)]
public partial class table: EntityObject
{
    [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
    [DataMemberAttribute()]
    public global::System.Int32 ID_TABLE
    {
        get
        {
            return _ID_TABLE;
        }
        set
        {
            if (_ID_TABLE != value)
            {
                OnID_TABLEChanging(value);
                ReportPropertyChanging("ID_TABLE");
                ID_TABLE = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ID_TABLE");
                OnID_TABLEChanged();
            }
        }
    }
    private global::System.Int32 ID_TABLE;
    partial void OnID_TABLEChanging(global::System.Int32 value);
    partial void OnID_TABLEChanged();
}
  • 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-15T14:48:27+00:00Added an answer on June 15, 2026 at 2:48 pm

    After reading the link provided by Steve Wilkes, WCF, Entity Framework & Data Contracts, it looks like it is not good to pass entity object from web service. So I have to create my own Data Transfer Object which is a mapping from the entity object, then pass it from the web service.

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

Sidebar

Related Questions

In a silverlight applicaiton i use entity framework as Data Access Layer. I want
I have several entities generated from my Entity Framework data model. In the .edmx
I am putting together a WCF Data Service for PatientEntities using Entity Framework. My
I have an ADO.NET Data Service that exposes an Entity Framework data model (.edmx).
I'm using Entity Framework 4 with an MVC3 application to access data. My SQL
I'm using entity framework. When an edmx file is generated, the connection string appears
For my ASP.NET MVC 2 application I use Entity Framework 1.0 as my data
Here's sample model classes, which being use with Entity Framework Code First: public class
When using the Entity Framework there are basically two ways to create your model.
I try to use SQL Server Compact Edition with Entity Framework in Visual Studio

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.