Are webservices persistent ?

Posted on 2005-03-24
Medium Priority
Last Modified: 2010-04-23
Hi :)

I'd like to know if there is a way to make a .NET WebService persistent.  Maybe they already are though, I'm not a VS expert here :)

Here is an example of what I need.

' *** '

Private x As Integer = 0

<WebMethod()> Public Function GetNext() As Integer
   x = x + 1
   Return x
End Function

' *** '

I want to ba able to call the GetNext method a couple of times and have 1, 2, 3, 4... as results.  Is there any way I can do that ?  

Thanks :)
Question by:qas
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

imperial_p79 earned 200 total points
ID: 13622968
All web method calls are stateless and so they wont be able to store the previous values. The one option that i can think of is for you to get the next number always from a database thru the web method.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month14 days, 3 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question