HighTechTalks DotNet Forums  

creating a BED properties class with web services

ASP.net Web Services microsoft.public.dotnet.framework.aspnet.webservices


Discuss creating a BED properties class with web services in the ASP.net Web Services forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
steven
 
Posts: n/a

Default creating a BED properties class with web services - 12-04-2007 , 09:44 AM






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.

tks

Reply With Quote
  #2  
Old   
John Saunders [MVP]
 
Posts: n/a

Default Re: creating a BED properties class with web services - 12-05-2007 , 03:35 PM






"steven" <s_mumby (AT) hotmail (DOT) com> wrote

Quote:
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




Reply With Quote
  #3  
Old   
steven
 
Posts: n/a

Default Re: creating a BED properties class with web services - 12-06-2007 , 02:33 PM



On Dec 5, 4:35 pm, "John Saunders [MVP]" <john.saunders at
trizetto.com> wrote:
Quote:
"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.
tks for the advice, john. my approch was feeling a little forced.

Quote:
--
---------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

--
---------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer- Hide quoted text -

- Show quoted text -


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.