Is it possible to declare static properties on a Web service?

Discussion in 'ASP .Net Web Services' started by Jeff Johnson, Jan 16, 2007.

  1. Jeff Johnson

    Jeff Johnson Guest

    I want to do this in my Web service:

    public static Guid ApplicationId
    {
    get { return _appId; }
    }

    And then in my external code do this:

    Guid webServiceGuid = MyWebServiceReference.MyWebServiceClass.ApplicationId;

    In other words, I want the Web reference that VS 2005 creates to discover
    this property through the WSDL and make it available to my code without
    having to actually call the Web service. Can it be done "out of the box"? If
    extra code is required (like modifying the behavior of the Web reference
    code generator) then forget it; I'll just hardcode the Guid. It's not going
    to change, after all. I just feel this method would be cleaner code-wise, if
    it's possible.
     
    Jeff Johnson, Jan 16, 2007
    #1
    1. Advertising

  2. There is no posible create static members in WebServises.

    "Jeff Johnson" <> wrote in message
    news:...
    >I want to do this in my Web service:
    >
    > public static Guid ApplicationId
    > {
    > get { return _appId; }
    > }
    >
    > And then in my external code do this:
    >
    > Guid webServiceGuid =
    > MyWebServiceReference.MyWebServiceClass.ApplicationId;
    >
    > In other words, I want the Web reference that VS 2005 creates to discover
    > this property through the WSDL and make it available to my code without
    > having to actually call the Web service. Can it be done "out of the box"?
    > If extra code is required (like modifying the behavior of the Web
    > reference code generator) then forget it; I'll just hardcode the Guid.
    > It's not going to change, after all. I just feel this method would be
    > cleaner code-wise, if it's possible.
    >
     
    Mariano Omar Rodriguez, Jan 16, 2007
    #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. Technical Support
    Replies:
    2
    Views:
    675
  2. ZelluX
    Replies:
    24
    Views:
    929
    Hendrik Maryns
    Nov 19, 2007
  3. Michael Fan
    Replies:
    2
    Views:
    148
    Michael Fan
    Jul 16, 2004
  4. Leo Violette
    Replies:
    0
    Views:
    1,088
    Leo Violette
    Apr 17, 2009
  5. Sergey Ilinsky
    Replies:
    2
    Views:
    120
    Michael Winter
    Mar 28, 2005
Loading...

Share This Page