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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:05:02+00:00 2026-05-18T04:05:02+00:00

I have an application that uses WebServices to send database records (as an array)

  • 0

I have an application that uses WebServices to send database records (as an array) to the client, yet even when sending only 1000 records it seems to be really slow.

The server is running on an IIS 7 and the client is a WPF application. Basically, how do I speed this up. Do I have to write a custom compression class or code? Is there just a setting I turn on/off on the IIS server and/or the client config files? Right now it takes about 4-7 seconds to return these 1000 records. So when we tie into the tables that can possibly return 10,000 – 40,000 records I don’t want the user to sit there for minutes waiting for data.

Here’s an example of the code:

Foo.svc:

namespace Foo.Server
{
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple)]
    public sealed class FooService : IFoo
    {
        public SelectRecordsResponse SelectRecords(SelectRecordsRequest request)
        {
            //I tested to ensure that this isn't my bottleneck
            FooBar[] records = ...;   //Stores 1000 records

            return new SelectRecordsResponse(records);
        }
    }
}

FooCommon.cs:

namespace Foo
{
    [ServiceContract(Namespace = "http://www.company.com/Services/Foo", ConfigurationName = "IFoo")]
    [ServiceKnownType(typeof(AbstractEntity))]
    [XmlSerializerFormat(SupportFaults = true, Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)]
    public interface IFoo
    {
        [OperationContract(Action = "http://www.company.com/Services/Foo/SelectRecords",
                           ReplyAction = "http://www.company.com/Services/Foo/SelectRecordsReply",
                           Name = "SelectRecords")]
        [ServiceKnownType(typeof(FooBar))]
        [return: MessageParameter(Name = "Response")]
        SelectRecordsResponse SelectRecords([MessageParameter(Name = "Request")]SelectRecordsRequest request);
    }

    [MessageContract(WrapperName = "SelectRecordsRequest", WrapperNamespace = "http://www.company.com/Services/Foo/", IsWrapped = true)]
    public sealed class SelectRecordsRequest
    {
        public SelectRecordsRequest()
        {
        }
    }

    [MessageContract(WrapperName = "SelectRecordsResponse", WrapperNamespace = "http://www.company.com/Services/Foo/", IsWrapped = true)]
    public sealed class SelectRecordsResponse
    {
        public SelectRecordsResponse()
        {
            Init();
        }

        public SelectRecordsResponse(FooBar[] records = null)
        {
            Init(records);
        }

        private void Init(FooBar[] records = null)
        {
            Records = records ?? new FooBar[0];
        }

        [MessageBodyMember(Namespace = "http://www.company.com/Services/Foo/", Order = 0, Name = "Records")]
        [XmlArray(ElementName = "SelectRecordsArray", Form = XmlSchemaForm.Qualified)]
        [XmlArrayItem(typeof(FooBar), ElementName = "SelectRecordsFooBar", Form = XmlSchemaForm.Qualified, IsNullable = true)]
        private FooBar[] Records { get; set; }
    }
}

FooClient.cs:

namespace Foo.Client
{
    public interface IFooChannel : IFoo, IClientChannel
    {
    }

    public sealed class FooClient : ClientBase<IFoo>, IFoo
    {
        public FooClient(String endpointConfigurationName) :
            base(endpointConfigurationName)
        {
        }

        public FooBar[] SelectRecords()
        {
            SelectRecordsRequest request = new SelectRecordsRequest();
            SelectRecordsResponse response = ((IFoo)(Client)).SelectRecords(request);

            return response.Records;
        }

        SelectRecordsResponse IFoo.SelectRecords(SelectRecordsRequest request)
        {
            return Channel.SelectRecords(request);
        }
    }
}
  • 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-18T04:05:02+00:00Added an answer on May 18, 2026 at 4:05 am

    It seems that the best way to reduce down the alloted time was a suggestion in the comments, that is paginating the data so that not as much is sent down. I do agree using something other than XML serialization will speed things up, but not enough. Also, using other serializations wasn’t acceptable since we had to go with an interop serialization method, in case we ever come out with a Java client instead.

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

Sidebar

Related Questions

No related questions found

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.