Shared functions in web services

Last post 05-16-2008 1:32 AM by anishgk80. 2 replies.

Sort Posts:

  • Shared functions in web services

    03-06-2007, 5:05 AM
    • Loading...
    • Ihab_Damen
    • Joined on 02-15-2007, 9:45 AM
    • Posts 7

    Dear Sir,

    Can we create a shared functions in a web service?

    If yes then how? I tried to add one but it was not accessable.

    Thanks

  • Re: Shared functions in web services

    03-07-2007, 9:35 AM
    • Loading...
    • TheGrox
    • Joined on 04-05-2006, 10:15 AM
    • Posts 85

    ?? Why would you not be able to use a shared function:

     In class file 'DBFunction':

    Shared

    Function ReturnHello() As String

    Return "Hellooooooo"

    End Function

    In asmx file:

    <WebMethod(Description:="Say Hello", CacheDuration:=120)> _

    Public Function SayHello() As String

    Return DBFunction.ReturnHello

    End Function

    Works fine, unless i've misunderstood your question?

  • Re: Shared functions in web services

    05-16-2008, 1:32 AM
    • Loading...
    • anishgk80
    • Joined on 02-27-2008, 9:50 AM
    • Posts 1

    Even I have tried the same thing. In my web service instance which I created in my web page, I was not able to view any function declared as "Shared" . The reason which I gess shared methods cannot be used in cases where you need to maintain state between several calls to an object. Not sure about this :-(

Page 1 of 1 (3 items)