Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Is it possible to declare static properties on a Web service?

Reply
Thread Tools

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

 
 
Jeff Johnson
Guest
Posts: n/a
 
      01-16-2007
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.


 
Reply With Quote
 
 
 
 
Mariano Omar Rodriguez
Guest
Posts: n/a
 
      01-16-2007
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.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.
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can't i declare a static variable in a static method? ZelluX Java 24 11-19-2007 11:58 AM
How to declare a static fstream within a class? Javi C++ 2 10-10-2005 11:57 AM
How to declare static members of a template class Old Wolf C++ 1 05-10-2005 03:01 AM
Different ways to declare methods/properties of an object Sergey Ilinsky Javascript 2 03-28-2005 03:51 PM
Declare Custom DLL Control in Code-Behind to set properties Technical Support ASP .Net 2 04-01-2004 08:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57