Groups | Blog | Home
all groups > dotnet web services > january 2007 >

dotnet web services : Is it possible to declare static properties on a Web service?


Jeff Johnson
1/16/2007 11:19:45 AM
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
1/16/2007 8:13:58 PM
There is no posible create static members in WebServises.

[quoted text, click to view]
AddThis Social Bookmark Button