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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:08:59+00:00 2026-05-12T18:08:59+00:00

READ FIRST before answering! I have a RESTful service which wraps around the Entity

  • 0

READ FIRST before answering!

I have a RESTful service which wraps around the Entity Framework. Basically, all I did was create a database, add relations between the tables, create an Entity model around this database and finally expose the whole thing as a RESTful *.svc service. This is done, cannot be changed either.

Now I need to query data from it through a client application. All I can access is the service itself. I cannot add any server-side code, even if I wanted to. The server is now locked.

I need to retrieve data from a table called “ProductVoorwaarden” (product conditions) which is linked to three other tables. (Rubriek, Categorie and Datatype.) This data needs to be returned as XML, with a root node called “PRODUCTVOORWAARDEN” and every record in it’s own XElement called “REC”. Within this REC, there’s an attribute for every field in the table plus references to related tables. Here’s the code I have right now:

XElement PRODUCTVOORWAARDEN()
{
    XElement Result = new XElement("PRODUCTVOORWAARDEN");
    var Brondata = COBA.Productvoorwaarden.OrderBy(O => O.Code);
    foreach (var item in Brondata)
    {
        COBA.LoadProperty(item, "Rubriek");
        COBA.LoadProperty(item, "Categorie");
        COBA.LoadProperty(item, "Datatype");
        XElement REC = new XElement("REC",
            Attribute("Rubriek", item.Rubriek.Code),
            Attribute("Categorie", item.Categorie.Naam),
            Attribute("Code", item.Code),
            Attribute("Datatype", item.Datatype.Naam),
            Attribute("Eenheid", item.Eenheid),
            Attribute("Naam", item.Naam),
            Attribute("Omschrijving", item.Omschrijving),
            Attribute("UitgebreideTekstVeld", item.UitgebreideTekstVeld),
            Attribute("Veld", item.Veld)
        );
        Result.Add(REC);
    }
    return Result;
}

This code works fine, but it’s slow. It reads all ProductVoorwaarden records but then it has to make round-trips to the server again for every record to retrieve Rubriek.Code, Categorie.Naam and Datatype.Naam. (In the database, these relations are set by an auto-incremental Identity field but the XML code uses Code or Naam as reference.)

As you can imagine, every trip back to the RESTful service just eats up more time, which I’m trying to avoid. So is there any way to speed this all up a bit more just on the client-side?


The server is still under development and the next release will take a few more months. As a result, I have to deal with the options that the server provides right now. If there’s no way to speed this up without modifying the server then fine. At least I’ve tried. There are 35 more tables that need to be processed with a deadline in a few days so if it works, then it works.

  • 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-12T18:08:59+00:00Added an answer on May 12, 2026 at 6:08 pm

    You could make each of your COBA.LoadProperty calls asynchronous and run them in parallel rather than sequentially. It will make your client code more complex since you’ll have to handle the return of each async call and determine when they have all completed and you’re ready to build your XML. Assuming each of your 4 REST calls is taking the same amount of time that would reduce the delay by half.

    You’ve probably already double checked but I have come across cases where generating the enumerator from the lambda expression can be expensive. Still it was in the hundreds of milliseconds and I get the impression your delay is larger than that. May be worth checking.

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

Sidebar

Related Questions

First of all,I'm not into web programming. I bumped into django and read a
Please read before answering. I dont want you to state the obvious for me.
How can I read the first line from a text file using a Windows
Having just read the first four chapters of Refactoring: Improving the Design of Existing
Python's convention is that variables are created by first assignment, and trying to read
Having read the threads Is SqlCommand.Dispose enough? and Closing and Disposing a WCF Service
Our Windows file server has an archive service installed that stubs files that have
I have read the following code: public class DalFactory { private static IDataContext _instance
We have to create a web service client using Apache CXF in Java. The
Before anything, let me first clarify that the below thoughts are purely my personal

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.