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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:15:43+00:00 2026-05-16T20:15:43+00:00

I’ve built a WCF Service in .NET 4.0 that basically just does standard CRUD

  • 0

I’ve built a WCF Service in .NET 4.0 that basically just does standard CRUD to a couple of tables on a MS SQL Server 2005 database. I’m using an ADO .NET Entity Data class to map to the database tables. So far, this has been really simple. I’ve just pulled the tables onto the design surface and let the tool do the work for me.

Here’s my issue. One of the methods of the service gives me an error (Internet Explorer cannot display the webpage) when trying to get any data from it. IE acts like it can’t contact the server, but the server is my local machine, and it can, in fact, contact the server when I browse to different methods. Here’s the method:

[WebGet(UriTemplate = "POS_AllowedValues")]
    public List<POS_AllowedValues> GetAllowedValues()
    {
        using (DENTSPLYEntities dentsply = new DENTSPLYEntities())
        {
            var allowed = dentsply.POS_AllowedValues.ToList();
            return allowed;
        }

    }

Unless I’m completely off my rocker, that should be returning a list of POS_AllowedValues objects when hitting the URL of the service and adding “/POS_AllowedValues” to the end. When looking at the help page of the service, that is indeed what it would indicate.

Now, the thing that really kills me is that the other methods all work fine. For instance, here’s the method GetPOSAccountXref

[WebGet(UriTemplate = "POS_AccountXref")]
    public List<POS_AccountXref> GetPOSAccountXref()
    {
        using (DENTSPLYEntities dentsply = new DENTSPLYEntities())
        {
            var posXref = dentsply.POS_AccountXref.ToList();
            return posXref;
        }

    }

That works fine! The only difference I can find so far at all between the two, is that the POS_AllowedValues object contains a navigation property to one of the other table entities, whereas the POS_AccountXref object does not.

I’m basically following the blog post found on blogs.msdn.com called Getting Started with WCF WebHttp Services in .NET 4.

Also, I am running this in the development web server in VS. This is entirely running on my dev box, using Windows 7 and VS 2010.

I really have no idea why this isn’t working. Any help at all would be greatly appreciated.

  • 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-16T20:15:44+00:00Added an answer on May 16, 2026 at 8:15 pm

    Turn off the lazy loading on your object model. Lazy loading is used by default. When you return your list of POS_AllowedValues the serialization accesses navigation property and it tryes to load related entities. But at this time object context is already disposed and exception is thrown. If you want to send related objects as well you have to explicitly load them (eager loading) by using Include() function on the queried object set.

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

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.