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

The Archive Base Latest Questions

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

When my web service returns a custom object (containing only four strings, three ints

  • 0

When my web service returns a custom object (containing only four strings, three ints and a bool) it takes several seconds (4-8seconds). When the same server sends the same information in a string it goes almost instantly.

The custom object class is defined in the same web service if that matters.

I didnt think it would make that much of a difference, or did I miss something fundamental here?

Edit:
Some code, I removed some of the variables for easier reading.

Custom class defined in the web service:

public class AddressSearchResult
{
    public AddressSearchResult()
    {
        Address = String.Empty;
        Country = String.Empty;
    }

    public AddressSearchResult(string address, string country)
    {
        Address = address;
        Country = country;
    }

    public string Address { get; set; }
    public string Country { get; set; }
}

Only difference between the two WebMethods on the web service is the return statement:

WebMethod1 returning the obj

return new AddressSearchResult((string)address["address"], (string)address["country"]);

WebMethod2 returning only a string (Just to show I’m doing the same thing here)

return new AddressSearchResult((string)address["address"], (string)address["country"]).Address;

Receiving side, the console app:

AddressSearchResult result = adrSerWS.method1("example", "yehaa"); //THIS IS SLOW
string result2 = adrSerWS.method2("example", "yehaa"); //THIS IS FAST
  • 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-15T13:55:49+00:00Added an answer on June 15, 2026 at 1:55 pm

    The problem might be that the first call to your web services takes longer than subsequent calls. Try switching the order of the service method calls you make in the console app and see if method1 is still the slowest.

    Why would the first call be slower? Some ideas: 1) In the console app, the first method call made may trigger some initialization in the web service proxy. This could be your own code or something in .NET. 2) You may be hitting the web service after IIS was idle for a while and thus it is having to spawn a new worker process. 3) If you’re running the console app with an attached debugger then note that this can exaggerate performance for the worst. Try running without the debugger.

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

Sidebar

Related Questions

Imagine a web service with a method that returns a Customer object, that takes
I have a web-service that returns a custom object, but now I want to
i'm trying to return a custome object from a web service object returned only
I have a web service that returns the binary array of an object. Is
I have a basic web service that returns the following object as JSON: public
I have been attempting recently to write a web service that returns a custom
My web service method returns a collection object, this will serialize nicely, thanks to
A web service return to my flex3 client this custom exception: <SOAP-ENV:Fault xmlns:ro=urn:Gov2gLibrary xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/
Scenario: Third party web service returns datetime in two separate fields i.e. date and
I'm consuming a web service using a stand-alone VBScript. The web service returns to

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.