![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
hi i'm working on a web site (written in .net 1.1) that makes heavy use of web services written in .net 2.0. the web site needs to sniff the URL being used and set certain parameters like db connections (to the QA or Production DB based on the URL). these properties should all be captured in an AppConfig properties class and passed to the web service. I'd like the AppConfig properties class to be written as a web service, but there doesn't seem to be any support for things like: WebMethod()> _ Public Property DBConn() Get Return _dbConn End Get Set(ByVal value) _dbConn = value End Set End Property i guess i could create this properties class with a bunch of functions to do this: WebMethod()>_ Public Function GetDbConn as String return _dbConn End Function WebMethod()>_ Public Sub SetDbConn(ByVal sDbConn As String) _dbConn = sDbConn End Sub but is there a more elegant way of doing this? any suggestions appreciated. |
#3
| |||
| |||
|
|
"steven" <s_mu... (AT) hotmail (DOT) com> wrote in message news:08634915-2af5-4642-a122-a7e5b6894100 (AT) s19g2000prg (DOT) googlegroups.com... hi i'm working on a web site (written in .net 1.1) that makes heavy use of web services written in .net 2.0. the web site needs to sniff the URL being used and set certain parameters like db connections (to the QA or Production DB based on the URL). these properties should all be captured in an AppConfig properties class and passed to the web service. I'd like the AppConfig properties class to be written as a web service, but there doesn't seem to be any support for things like: WebMethod()> _ Public Property DBConn() Get Return _dbConn End Get Set(ByVal value) _dbConn = value End Set End Property i guess i could create this properties class with a bunch of functions to do this: WebMethod()>_ Public Function GetDbConn as String return _dbConn End Function WebMethod()>_ Public Sub SetDbConn(ByVal sDbConn As String) _dbConn = sDbConn End Sub but is there a more elegant way of doing this? any suggestions appreciated. Sorry, web methods can only be methods. Furthermore, you should consider something more granular. Keep in mind that each reference to a web method is a request/response pair. You don't really want to do 10 separate request/response exchanges just to fetch 10 properties. Instead, consider wrapping a set of properties in a class, and have a single web method called, say, "GetConfigurationProperties" that returns the entire set. The client can then access the individual properties however it likes. |
|
-- --------------------------------------------------------------------------------- John Saunders | MVP - Windows Server System - Connected System Developer -- --------------------------------------------------------------------------------- John Saunders | MVP - Windows Server System - Connected System Developer- Hide quoted text - - Show quoted text - |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |