Web service from Client application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • floresa9
    New Member
    • Aug 2007
    • 2

    Web service from Client application

    Hello,

    I developed a C# application with a Web Service also in C#, the application creates the web service instance at the beginning of the application and call the first web method in the first call delays the response, the next web method works quick, then I pass as a parameter the class in which I call the web method to another form and when I called the next web method, the delay happens again, this occurs each time I call another option in the program.
    When I have the option working, tha calls to the web methods answer quick.

    Please somebody knows what can I do?

    Thanks,

    AFG
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by floresa9
    Hello,

    I developed a C# application with a Web Service also in C#, the application creates the web service instance at the beginning of the application and call the first web method in the first call delays the response, the next web method works quick, then I pass as a parameter the class in which I call the web method to another form and when I called the next web method, the delay happens again, this occurs each time I call another option in the program.
    When I have the option working, tha calls to the web methods answer quick.

    Please somebody knows what can I do?

    Thanks,

    AFG
    Greetings and welcome to TSDN; you posted your question in an Articles section.
    This section is for informative articles only. The Forum sections are for question
    such as yours. I'm moving your question to the appropriate forum.

    kind regards,

    Jos

    Comment

    • nateraaaa
      Recognized Expert Contributor
      • May 2007
      • 664

      #3
      Originally posted by floresa9
      Hello,

      I developed a C# application with a Web Service also in C#, the application creates the web service instance at the beginning of the application and call the first web method in the first call delays the response, the next web method works quick, then I pass as a parameter the class in which I call the web method to another form and when I called the next web method, the delay happens again, this occurs each time I call another option in the program.
      When I have the option working, tha calls to the web methods answer quick.

      Please somebody knows what can I do?

      Thanks,

      AFG
      If I understand your question correctly you are asking why the first Web Service call takes longer than all of the other calls after the first call. Web Services are designed to work this way. The first call will always take longer than any other call after the first. However if your application will be using this Web Services many times the benefits should outweigh this small nuisance.

      Nathan

      Comment

      • floresa9
        New Member
        • Aug 2007
        • 2

        #4
        Originally posted by nateraaaa
        If I understand your question correctly you are asking why the first Web Service call takes longer than all of the other calls after the first call. Web Services are designed to work this way. The first call will always take longer than any other call after the first. However if your application will be using this Web Services many times the benefits should outweigh this small nuisance.

        Nathan
        Thanks fore your answer, Yes I know in the first call a web services takes a long time, my problem is, I make the instance of the web service at the very beginning of the client application in a class. After the user was login I call another windows form, this windows forms takes in a parameter the instance of the web service after that I call a web method to bring some information from the server, the data from the server is compressed, well, when I do the first call the web service takes a long time again and in the next calls the response is good under the same object.

        I think when I change from one object to another the web services believe that is a new instance.

        Comment

        Working...