access a classic asp variable from within a webservice

Discussion in 'ASP .Net Web Services' started by Kiran, Oct 21, 2006.

  1. Kiran

    Kiran Guest

    Here is the situation :

    ***************************
    parent.asp
    ***************************
    <!-- #INCLUDE FILE="../includes/inc_html.asp" -->

    Dim iVar
    iVar = 20

    Dim sText
    sText = GetHtml()
    ***************************
    inc_html.asp
    *********************
    function GetHtml()
    select case iVar
    case 10
    GetHtml = "This is the output for you item # 10"
    case 20
    GetHtml = "You opted for item # 20"
    case 30
    GetHtml = "# 30 seems to be pretty expensive"
    end select

    *******************************************************
    My job is to convert inc_html.asp to an asp.net webservice.
    I tested calling the web method of the web service from .asp and it all works.

    My question is., is there a way to access the value of iVar(declared in the
    parent asp)
    from within the webservice without passing the iVar to the webmethod as a
    parameter.
    Or create a property or something in the Webmethod ? just a thought
     
    Kiran, Oct 21, 2006
    #1
    1. Advertising

  2. Kiran

    Scott M. Guest

    > My question is., is there a way to access the value of iVar(declared in
    > the
    > parent asp)
    > from within the webservice without passing the iVar to the webmethod as a
    > parameter.


    No. WebServices are not statefull objects so you must give them what they
    need to do their work and for you to get back your result.
     
    Scott M., Oct 21, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWlrZQ==?=
    Replies:
    1
    Views:
    1,112
    Larry Bud
    Jul 30, 2007
  2. Steve Kuhn
    Replies:
    2
    Views:
    355
    majiofpersia
    Jul 29, 2003
  3. AdamC
    Replies:
    0
    Views:
    272
    AdamC
    May 16, 2007
  4. René Preußler

    Asynchronous Call of WebService method within a WebService

    René Preußler, Oct 29, 2008, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    199
    René Preußler
    Oct 29, 2008
  5. Adam Short
    Replies:
    18
    Views:
    1,119
    Adam Short
    Mar 23, 2005
Loading...

Share This Page