By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,166 Members | 1,203 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,166 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.Applicatio nId;

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.
Jan 16 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
There is no posible create static members in WebServises.

"Jeff Johnson" <i.***@enough.spamwrote in message
news:ex**************@TK2MSFTNGP04.phx.gbl...
>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.Applicatio nId;

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.
Jan 16 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.