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

J

Jeff Johnson

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top