Ask a Question related to ASP.NET Web Services, Design and Development.
-
Bubba Thomas #1
Passing Parameters into NEW()
Is there any way that the NEW() of a web service can accept parameters ? I
would like to pass a boolean to indicate to the webservice that I am in test
mode or live mode. This will give me the ability to set up which Database I
want to use on the back end. If I cannot do it this way does anyone know of
another way I can do it ? I have a WebService that has about 75 procedures
and I would rather not have to submit this parameter into every one of them.
I would like to do something like this :
Private agentMonitorConnectionStringLive As String =
"uid=callManager;pwd=liveon070703;" &
"database=callManager;server=129.110.10.235;Connec t Timeout=45"
Private agentMonitorConnectionStringTest As String =
"uid=callManager;pwd=callManager;" &
"database=callManager;server=129.110.205.11;poolin g='false';Connect
Timeout=45"
Private queueMessagesConnectionLive As String =
"uid=FrontOffice;pwd=liveon070703;" &
"database=FrontOffice;server=129.110.10.235;Connec t Timeout=45"
Private queueMessagesConnectionTest As String =
"uid=FrontOffice;pwd=FrontOffice;" &
"database=FrontOffice;server=129.110.205.11;Connec t Timeout=45"
Public agentMonitorConnectionString As String
Public queueMessagesConnectionString As String
Public Sub New(ByVal LiveMode As Boolean)
If LiveMode Then
agentMonitorConnectionString = agentMonitorConnectionStringLive
queueMessagesConnectionString = queueMessagesConnectionLive
Else
agentMonitorConnectionString = agentMonitorConnectionStringTest
queueMessagesConnectionString = queueMessagesConnectionTest
End If
End Sub
TIA !
Bubba !
Bubba Thomas Guest
-
Passing Parameters To CFC
I am testing how to return data from a CFC within Flash Forms. I have a simple <cfselect> tag that will hold data returned from a CFC. This CFC... -
Question on Passing URL Parameters
Thanks in advance for any responses to this question! I have a dynamic table (in a master page using javascript and asp) that links to a detail... -
cflocation - passing parameters
Hi, Is it possible to do the following with CF? If not how can it be done. <cflocation url='template.cfm?id=#id#'> Thanks in advance -
passing parameters
Hi Michael, I think you want to modify the links in web control programmatically. You can add several Hyperlink controls to the user control,... -
Help Passing Parameters
Before going to the third script I'd suggest storing the variables in session variables. Here's how I generally do login scripts. Perhaps have... -
Jan Tielens #2
Re: Passing Parameters into NEW()
This is not possible.
Also it doesn't fit the stateless nature of webservices.
--
Greetz,
Jan
__________________________________
Read my weblog: [url]http://weblogs.asp.net/jan[/url]
"Bubba Thomas" <bubba@ILU.com> schreef in bericht
news:uAbJ0hs2DHA.2868@TK2MSFTNGP09.phx.gbl...I> Is there any way that the NEW() of a web service can accept parameters ?test> would like to pass a boolean to indicate to the webservice that I am inI> mode or live mode. This will give me the ability to set up which Databaseof> want to use on the back end. If I cannot do it this way does anyone knowprocedures> another way I can do it ? I have a WebService that has about 75them.> and I would rather not have to submit this parameter into every one of>
> I would like to do something like this :
>
>
> Private agentMonitorConnectionStringLive As String =
> "uid=callManager;pwd=liveon070703;" &
> "database=callManager;server=129.110.10.235;Connec t Timeout=45"
> Private agentMonitorConnectionStringTest As String =
> "uid=callManager;pwd=callManager;" &
> "database=callManager;server=129.110.205.11;poolin g='false';Connect
> Timeout=45"
> Private queueMessagesConnectionLive As String =
> "uid=FrontOffice;pwd=liveon070703;" &
> "database=FrontOffice;server=129.110.10.235;Connec t Timeout=45"
> Private queueMessagesConnectionTest As String =
> "uid=FrontOffice;pwd=FrontOffice;" &
> "database=FrontOffice;server=129.110.205.11;Connec t Timeout=45"
> Public agentMonitorConnectionString As String
> Public queueMessagesConnectionString As String
>
> Public Sub New(ByVal LiveMode As Boolean)
>
> If LiveMode Then
> agentMonitorConnectionString = agentMonitorConnectionStringLive
> queueMessagesConnectionString = queueMessagesConnectionLive
> Else
> agentMonitorConnectionString = agentMonitorConnectionStringTest
> queueMessagesConnectionString = queueMessagesConnectionTest
> End If
>
> End Sub
>
>
>
> TIA !
>
>
> Bubba !
>
>
Jan Tielens Guest
-
Michael Pearson #3
Re: Passing Parameters into NEW()
Well, you could setup two different webservices. In your client side code,
determine if you are in debug mode and call one or the other.
How does that sound?
Michael
"Bubba Thomas" <bubba@ILU.com> wrote in message
news:uAbJ0hs2DHA.2868@TK2MSFTNGP09.phx.gbl...I> Is there any way that the NEW() of a web service can accept parameters ?test> would like to pass a boolean to indicate to the webservice that I am inI> mode or live mode. This will give me the ability to set up which Databaseof> want to use on the back end. If I cannot do it this way does anyone knowprocedures> another way I can do it ? I have a WebService that has about 75them.> and I would rather not have to submit this parameter into every one of>
> I would like to do something like this :
>
>
> Private agentMonitorConnectionStringLive As String =
> "uid=callManager;pwd=liveon070703;" &
> "database=callManager;server=129.110.10.235;Connec t Timeout=45"
> Private agentMonitorConnectionStringTest As String =
> "uid=callManager;pwd=callManager;" &
> "database=callManager;server=129.110.205.11;poolin g='false';Connect
> Timeout=45"
> Private queueMessagesConnectionLive As String =
> "uid=FrontOffice;pwd=liveon070703;" &
> "database=FrontOffice;server=129.110.10.235;Connec t Timeout=45"
> Private queueMessagesConnectionTest As String =
> "uid=FrontOffice;pwd=FrontOffice;" &
> "database=FrontOffice;server=129.110.205.11;Connec t Timeout=45"
> Public agentMonitorConnectionString As String
> Public queueMessagesConnectionString As String
>
> Public Sub New(ByVal LiveMode As Boolean)
>
> If LiveMode Then
> agentMonitorConnectionString = agentMonitorConnectionStringLive
> queueMessagesConnectionString = queueMessagesConnectionLive
> Else
> agentMonitorConnectionString = agentMonitorConnectionStringTest
> queueMessagesConnectionString = queueMessagesConnectionTest
> End If
>
> End Sub
>
>
>
> TIA !
>
>
> Bubba !
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
Version: 6.0.560 / Virus Database: 352 - Release Date: 1/8/2004
Michael Pearson Guest
-
Matthew Holton #4
Passing Parameters into NEW()
May I suggest an additional header, pass one in if you
are in debug mode, and not if you are not.
Class OptionalHeader : Inherits SoapHeader
Public DebugMode as boolean
End Class
accept parameters ? I>-----Original Message-----
>Is there any way that the NEW() of a web service canwebservice that I am in test>would like to pass a boolean to indicate to theup which Database I>mode or live mode. This will give me the ability to setdoes anyone know of>want to use on the back end. If I cannot do it this wayabout 75 procedures>another way I can do it ? I have a WebService that hasinto every one of them.>and I would rather not have to submit this parameterTimeout=45">
>I would like to do something like this :
>
>
>Private agentMonitorConnectionStringLive As String =
>"uid=callManager;pwd=liveon070703;" &
>"database=callManager;server=129.110.10.235;Conne cte';Connect>Private agentMonitorConnectionStringTest As String =
>"uid=callManager;pwd=callManager;" &
>"database=callManager;server=129.110.205.11;pooli ng='falsTimeout=45">Timeout=45"
>Private queueMessagesConnectionLive As String =
>"uid=FrontOffice;pwd=liveon070703;" &
>"database=FrontOffice;server=129.110.10.235;Conne ctTimeout=45">Private queueMessagesConnectionTest As String =
>"uid=FrontOffice;pwd=FrontOffice;" &
>"database=FrontOffice;server=129.110.205.11;Conne ctagentMonitorConnectionStringLive>Public agentMonitorConnectionString As String
>Public queueMessagesConnectionString As String
>
>Public Sub New(ByVal LiveMode As Boolean)
>
> If LiveMode Then
> agentMonitorConnectionString =queueMessagesConnectionLive> queueMessagesConnectionString =agentMonitorConnectionStringTest> Else
> agentMonitorConnectionString =queueMessagesConnectionTest> queueMessagesConnectionString => End If
>
>End Sub
>
>
>
>TIA !
>
>
>Bubba !
>
>
>.
>Matthew Holton Guest
-
Bubba Thomas #5
Re: Passing Parameters into NEW()
This would be my LAST resort as there are many, many objects that have to
have access to the webservice.
I appreciate the help anyway !
Bubba !
"Michael Pearson" <michaelp_extrajunktoremove@televox.com> wrote in message
news:OiM0fMw2DHA.3656@TK2MSFTNGP11.phx.gbl...code,> Well, you could setup two different webservices. In your client sideDatabase> determine if you are in debug mode and call one or the other.
>
> How does that sound?
>
> Michael
>
> "Bubba Thomas" <bubba@ILU.com> wrote in message
> news:uAbJ0hs2DHA.2868@TK2MSFTNGP09.phx.gbl...> I> > Is there any way that the NEW() of a web service can accept parameters ?> test> > would like to pass a boolean to indicate to the webservice that I am in> > mode or live mode. This will give me the ability to set up whichknow> I> > want to use on the back end. If I cannot do it this way does anyone> of> procedures> > another way I can do it ? I have a WebService that has about 75> them.> > and I would rather not have to submit this parameter into every one of>> >
> > I would like to do something like this :
> >
> >
> > Private agentMonitorConnectionStringLive As String =
> > "uid=callManager;pwd=liveon070703;" &
> > "database=callManager;server=129.110.10.235;Connec t Timeout=45"
> > Private agentMonitorConnectionStringTest As String =
> > "uid=callManager;pwd=callManager;" &
> > "database=callManager;server=129.110.205.11;poolin g='false';Connect
> > Timeout=45"
> > Private queueMessagesConnectionLive As String =
> > "uid=FrontOffice;pwd=liveon070703;" &
> > "database=FrontOffice;server=129.110.10.235;Connec t Timeout=45"
> > Private queueMessagesConnectionTest As String =
> > "uid=FrontOffice;pwd=FrontOffice;" &
> > "database=FrontOffice;server=129.110.205.11;Connec t Timeout=45"
> > Public agentMonitorConnectionString As String
> > Public queueMessagesConnectionString As String
> >
> > Public Sub New(ByVal LiveMode As Boolean)
> >
> > If LiveMode Then
> > agentMonitorConnectionString = agentMonitorConnectionStringLive
> > queueMessagesConnectionString = queueMessagesConnectionLive
> > Else
> > agentMonitorConnectionString = agentMonitorConnectionStringTest
> > queueMessagesConnectionString = queueMessagesConnectionTest
> > End If
> >
> > End Sub
> >
> >
> >
> > TIA !
> >
> >
> > Bubba !
> >
> >
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
> Version: 6.0.560 / Virus Database: 352 - Release Date: 1/8/2004
>
>
Bubba Thomas Guest
-
Bubba Thomas #6
Re: Passing Parameters into NEW()
I am not familiar with this idea.... Could you give me an example (or point
me to one) ?
I would really appreciate it !
ThanX
Bubba !
"Matthew Holton" <mholton@americasdoctor.com> wrote in message
news:056701c3db18$0c200930$a501280a@phx.gbl...> May I suggest an additional header, pass one in if you
> are in debug mode, and not if you are not.
>
> Class OptionalHeader : Inherits SoapHeader
> Public DebugMode as boolean
> End Class
>
>
>> accept parameters ? I> >-----Original Message-----
> >Is there any way that the NEW() of a web service can> webservice that I am in test> >would like to pass a boolean to indicate to the> up which Database I> >mode or live mode. This will give me the ability to set> does anyone know of> >want to use on the back end. If I cannot do it this way> about 75 procedures> >another way I can do it ? I have a WebService that has> into every one of them.> >and I would rather not have to submit this parameter> Timeout=45"> >
> >I would like to do something like this :
> >
> >
> >Private agentMonitorConnectionStringLive As String =
> >"uid=callManager;pwd=liveon070703;" &
> >"database=callManager;server=129.110.10.235;Conne ct> e';Connect> >Private agentMonitorConnectionStringTest As String =
> >"uid=callManager;pwd=callManager;" &
> >"database=callManager;server=129.110.205.11;pooli ng='fals> Timeout=45"> >Timeout=45"
> >Private queueMessagesConnectionLive As String =
> >"uid=FrontOffice;pwd=liveon070703;" &
> >"database=FrontOffice;server=129.110.10.235;Conne ct> Timeout=45"> >Private queueMessagesConnectionTest As String =
> >"uid=FrontOffice;pwd=FrontOffice;" &
> >"database=FrontOffice;server=129.110.205.11;Conne ct> agentMonitorConnectionStringLive> >Public agentMonitorConnectionString As String
> >Public queueMessagesConnectionString As String
> >
> >Public Sub New(ByVal LiveMode As Boolean)
> >
> > If LiveMode Then
> > agentMonitorConnectionString => queueMessagesConnectionLive> > queueMessagesConnectionString => agentMonitorConnectionStringTest> > Else
> > agentMonitorConnectionString => queueMessagesConnectionTest> > queueMessagesConnectionString => > End If
> >
> >End Sub
> >
> >
> >
> >TIA !
> >
> >
> >Bubba !
> >
> >
> >.
> >
Bubba Thomas Guest
-
Matthew Holton #7
Re: Passing Parameters into NEW()
Certainly
Imports System.Web.Services
Imports System.Web.Services.Protocols
' Define a SOAP header by deriving from the SoapHeader
base class.
Public Class StartUpParamaters : Inherits SoapHeader
Public IsDegug As Boolean
Public Sub New()
'
'
'
End Sub
End Class
<WebService(Namespace:="http://myserver.mydomain.com/")>
Public Class Manager
Inherits System.Web.Services.WebService
Public oHead as StartUpParamaters
<WebMethod(EnableSession:=True), SoapHeader
("oHead",Direction := SoapHeaderDirection.In, _
Required := False))> Public Function Login(ByVal
UserName As String, ByVal Password As String) As Integer
if oHead.IsDebug then
'Write to trace log
end if
End Function
End Class
'Client
Public Shared Sub Main()
Dim ws As New Manager()
Try
Dim customHeader As New StartUpParamaters()
customHeader.IsDebug = True
ws.myHeader = customHeader
Dim results As Integer
results = ws.Login("UserName","Password")
Catch e As Exception
Console.WriteLine("Exception: {0}", e.ToString
())
End Try
End Sub
ms-
help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebServices
ProtocolsSoapHeaderClassMustUnderstandTopic.htm
ms-
help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebServices
ProtocolsSoapHeaderAttributeClassDirectionTopic.ht m
ms-
help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebServices
ProtocolsSoapHeaderAttributeClassRequiredTopic.htm
HTH
Matthew
an example (or point>-----Original Message-----
>I am not familiar with this idea.... Could you give memessage>me to one) ?
>
>I would really appreciate it !
>
>
>ThanX
>
>Bubba !
>
>
>"Matthew Holton" <mholton@americasdoctor.com> wrote inset>news:056701c3db18$0c200930$a501280a@phx.gbl...>> May I suggest an additional header, pass one in if you
>> are in debug mode, and not if you are not.
>>
>> Class OptionalHeader : Inherits SoapHeader
>> Public DebugMode as boolean
>> End Class
>>
>>
>>>> accept parameters ? I>> >-----Original Message-----
>> >Is there any way that the NEW() of a web service can>> webservice that I am in test>> >would like to pass a boolean to indicate to the>> >mode or live mode. This will give me the ability toway>> up which Database I>> >want to use on the back end. If I cannot do it thishas>> does anyone know of>> >another way I can do it ? I have a WebService that>"database=callManager;server=129.110.205.11;pooli ng='fals>> about 75 procedures>> into every one of them.>> >and I would rather not have to submit this parameter>> Timeout=45">> >
>> >I would like to do something like this :
>> >
>> >
>> >Private agentMonitorConnectionStringLive As String =
>> >"uid=callManager;pwd=liveon070703;" &
>> >"database=callManager;server=129.110.10.235;Conne ct>>>> >Private agentMonitorConnectionStringTest As String =
>> >"uid=callManager;pwd=callManager;" &>>> e';Connect>> Timeout=45">> >Timeout=45"
>> >Private queueMessagesConnectionLive As String =
>> >"uid=FrontOffice;pwd=liveon070703;" &
>> >"database=FrontOffice;server=129.110.10.235;Conne ct>> Timeout=45">> >Private queueMessagesConnectionTest As String =
>> >"uid=FrontOffice;pwd=FrontOffice;" &
>> >"database=FrontOffice;server=129.110.205.11;Conne ct>> agentMonitorConnectionStringLive>> >Public agentMonitorConnectionString As String
>> >Public queueMessagesConnectionString As String
>> >
>> >Public Sub New(ByVal LiveMode As Boolean)
>> >
>> > If LiveMode Then
>> > agentMonitorConnectionString =>> queueMessagesConnectionLive>> > queueMessagesConnectionString =>> agentMonitorConnectionStringTest>> > Else
>> > agentMonitorConnectionString =>> queueMessagesConnectionTest>> > queueMessagesConnectionString =>> > End If
>> >
>> >End Sub
>> >
>> >
>> >
>> >TIA !
>> >
>> >
>> >Bubba !
>> >
>> >
>> >.
>> >
>
>.
>Matthew Holton Guest
-
Bubba Thomas #8
Re: Passing Parameters into NEW()
ThanX,
I am gonna give it a go ...
I will let you know how it goes.
Bubba
"Matthew Holton" <mholton@americasdoctor.com> wrote in message
news:0d5c01c3db76$f72e81f0$a101280a@phx.gbl...> Certainly
>
> Imports System.Web.Services
> Imports System.Web.Services.Protocols
>
> ' Define a SOAP header by deriving from the SoapHeader
> base class.
> Public Class StartUpParamaters : Inherits SoapHeader
> Public IsDegug As Boolean
> Public Sub New()
> '
> '
> '
> End Sub
> End Class
>
>
> <WebService(Namespace:="http://myserver.mydomain.com/")>
> Public Class Manager
> Inherits System.Web.Services.WebService
>
> Public oHead as StartUpParamaters
>
> <WebMethod(EnableSession:=True), SoapHeader
> ("oHead",Direction := SoapHeaderDirection.In, _
> Required := False))> Public Function Login(ByVal
> UserName As String, ByVal Password As String) As Integer
>
> if oHead.IsDebug then
> 'Write to trace log
> end if
> End Function
> End Class
>
> 'Client
>
> Public Shared Sub Main()
> Dim ws As New Manager()
>
> Try
> Dim customHeader As New StartUpParamaters()
>
> customHeader.IsDebug = True
>
> ws.myHeader = customHeader
>
> Dim results As Integer
>
> results = ws.Login("UserName","Password")
> Catch e As Exception
> Console.WriteLine("Exception: {0}", e.ToString
> ())
> End Try
> End Sub
>
> ms-
> help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebServices
> ProtocolsSoapHeaderClassMustUnderstandTopic.htm
>
> ms-
> help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebServices
> ProtocolsSoapHeaderAttributeClassDirectionTopic.ht m
>
> ms-
> help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebServices
> ProtocolsSoapHeaderAttributeClassRequiredTopic.htm
>
>
> HTH
>
> Matthew
>> an example (or point> >-----Original Message-----
> >I am not familiar with this idea.... Could you give me> message> >me to one) ?
> >
> >I would really appreciate it !
> >
> >
> >ThanX
> >
> >Bubba !
> >
> >
> >"Matthew Holton" <mholton@americasdoctor.com> wrote in> set> >news:056701c3db18$0c200930$a501280a@phx.gbl...> >> May I suggest an additional header, pass one in if you
> >> are in debug mode, and not if you are not.
> >>
> >> Class OptionalHeader : Inherits SoapHeader
> >> Public DebugMode as boolean
> >> End Class
> >>
> >>
> >>
> >> >-----Original Message-----
> >> >Is there any way that the NEW() of a web service can
> >> accept parameters ? I
> >> >would like to pass a boolean to indicate to the
> >> webservice that I am in test
> >> >mode or live mode. This will give me the ability to> way> >> up which Database I
> >> >want to use on the back end. If I cannot do it this> has> >> does anyone know of
> >> >another way I can do it ? I have a WebService that> >"database=callManager;server=129.110.205.11;pooli ng='fals> >> about 75 procedures
> >> >and I would rather not have to submit this parameter
> >> into every one of them.
> >> >
> >> >I would like to do something like this :
> >> >
> >> >
> >> >Private agentMonitorConnectionStringLive As String =
> >> >"uid=callManager;pwd=liveon070703;" &
> >> >"database=callManager;server=129.110.10.235;Conne ct
> >> Timeout=45"
> >> >Private agentMonitorConnectionStringTest As String =
> >> >"uid=callManager;pwd=callManager;" &
> >>> >> >> e';Connect
> >> >Timeout=45"
> >> >Private queueMessagesConnectionLive As String =
> >> >"uid=FrontOffice;pwd=liveon070703;" &
> >> >"database=FrontOffice;server=129.110.10.235;Conne ct
> >> Timeout=45"
> >> >Private queueMessagesConnectionTest As String =
> >> >"uid=FrontOffice;pwd=FrontOffice;" &
> >> >"database=FrontOffice;server=129.110.205.11;Conne ct
> >> Timeout=45"
> >> >Public agentMonitorConnectionString As String
> >> >Public queueMessagesConnectionString As String
> >> >
> >> >Public Sub New(ByVal LiveMode As Boolean)
> >> >
> >> > If LiveMode Then
> >> > agentMonitorConnectionString =
> >> agentMonitorConnectionStringLive
> >> > queueMessagesConnectionString =
> >> queueMessagesConnectionLive
> >> > Else
> >> > agentMonitorConnectionString =
> >> agentMonitorConnectionStringTest
> >> > queueMessagesConnectionString =
> >> queueMessagesConnectionTest
> >> > End If
> >> >
> >> >End Sub
> >> >
> >> >
> >> >
> >> >TIA !
> >> >
> >> >
> >> >Bubba !
> >> >
> >> >
> >> >.
> >> >
> >
> >.
> >
Bubba Thomas Guest
-
Bubba Thomas #9
Re: Passing Parameters into NEW()
I presume that I need to place the following at each one of my functions and
procedures ?
<WebMethod(EnableSession:=True), SoapHeader("oHead",Direction :=
SoapHeaderDirection.In, _
Required := False))> PUBLIC FUNCTION () OR PROCEDURE()
ThanX again for the help !
Bubba !
"Matthew Holton" <mholton@americasdoctor.com> wrote in message
news:0d5c01c3db76$f72e81f0$a101280a@phx.gbl...> Certainly
>
> Imports System.Web.Services
> Imports System.Web.Services.Protocols
>
> ' Define a SOAP header by deriving from the SoapHeader
> base class.
> Public Class StartUpParamaters : Inherits SoapHeader
> Public IsDegug As Boolean
> Public Sub New()
> '
> '
> '
> End Sub
> End Class
>
>
> <WebService(Namespace:="http://myserver.mydomain.com/")>
> Public Class Manager
> Inherits System.Web.Services.WebService
>
> Public oHead as StartUpParamaters
>
> <WebMethod(EnableSession:=True), SoapHeader
> ("oHead",Direction := SoapHeaderDirection.In, _
> Required := False))> Public Function Login(ByVal
> UserName As String, ByVal Password As String) As Integer
>
> if oHead.IsDebug then
> 'Write to trace log
> end if
> End Function
> End Class
>
> 'Client
>
> Public Shared Sub Main()
> Dim ws As New Manager()
>
> Try
> Dim customHeader As New StartUpParamaters()
>
> customHeader.IsDebug = True
>
> ws.myHeader = customHeader
>
> Dim results As Integer
>
> results = ws.Login("UserName","Password")
> Catch e As Exception
> Console.WriteLine("Exception: {0}", e.ToString
> ())
> End Try
> End Sub
>
> ms-
> help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebServices
> ProtocolsSoapHeaderClassMustUnderstandTopic.htm
>
> ms-
> help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebServices
> ProtocolsSoapHeaderAttributeClassDirectionTopic.ht m
>
> ms-
> help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebServices
> ProtocolsSoapHeaderAttributeClassRequiredTopic.htm
>
>
> HTH
>
> Matthew
>> an example (or point> >-----Original Message-----
> >I am not familiar with this idea.... Could you give me> message> >me to one) ?
> >
> >I would really appreciate it !
> >
> >
> >ThanX
> >
> >Bubba !
> >
> >
> >"Matthew Holton" <mholton@americasdoctor.com> wrote in> set> >news:056701c3db18$0c200930$a501280a@phx.gbl...> >> May I suggest an additional header, pass one in if you
> >> are in debug mode, and not if you are not.
> >>
> >> Class OptionalHeader : Inherits SoapHeader
> >> Public DebugMode as boolean
> >> End Class
> >>
> >>
> >>
> >> >-----Original Message-----
> >> >Is there any way that the NEW() of a web service can
> >> accept parameters ? I
> >> >would like to pass a boolean to indicate to the
> >> webservice that I am in test
> >> >mode or live mode. This will give me the ability to> way> >> up which Database I
> >> >want to use on the back end. If I cannot do it this> has> >> does anyone know of
> >> >another way I can do it ? I have a WebService that> >"database=callManager;server=129.110.205.11;pooli ng='fals> >> about 75 procedures
> >> >and I would rather not have to submit this parameter
> >> into every one of them.
> >> >
> >> >I would like to do something like this :
> >> >
> >> >
> >> >Private agentMonitorConnectionStringLive As String =
> >> >"uid=callManager;pwd=liveon070703;" &
> >> >"database=callManager;server=129.110.10.235;Conne ct
> >> Timeout=45"
> >> >Private agentMonitorConnectionStringTest As String =
> >> >"uid=callManager;pwd=callManager;" &
> >>> >> >> e';Connect
> >> >Timeout=45"
> >> >Private queueMessagesConnectionLive As String =
> >> >"uid=FrontOffice;pwd=liveon070703;" &
> >> >"database=FrontOffice;server=129.110.10.235;Conne ct
> >> Timeout=45"
> >> >Private queueMessagesConnectionTest As String =
> >> >"uid=FrontOffice;pwd=FrontOffice;" &
> >> >"database=FrontOffice;server=129.110.205.11;Conne ct
> >> Timeout=45"
> >> >Public agentMonitorConnectionString As String
> >> >Public queueMessagesConnectionString As String
> >> >
> >> >Public Sub New(ByVal LiveMode As Boolean)
> >> >
> >> > If LiveMode Then
> >> > agentMonitorConnectionString =
> >> agentMonitorConnectionStringLive
> >> > queueMessagesConnectionString =
> >> queueMessagesConnectionLive
> >> > Else
> >> > agentMonitorConnectionString =
> >> agentMonitorConnectionStringTest
> >> > queueMessagesConnectionString =
> >> queueMessagesConnectionTest
> >> > End If
> >> >
> >> >End Sub
> >> >
> >> >
> >> >
> >> >TIA !
> >> >
> >> >
> >> >Bubba !
> >> >
> >> >
> >> >.
> >> >
> >
> >.
> >
Bubba Thomas Guest
-
Re: Passing Parameters into NEW()
You are correct.
of my functions and>-----Original Message-----
>I presume that I need to place the following at each one("oHead",Direction :=>procedures ?
>
><WebMethod(EnableSession:=True), SoapHeaderPROCEDURE()>SoapHeaderDirection.In, _
> Required := False))> PUBLIC FUNCTION () ORmessage>
>ThanX again for the help !
>
>Bubba !
>
>
>"Matthew Holton" <mholton@americasdoctor.com> wrote inInteger>news:0d5c01c3db76$f72e81f0$a101280a@phx.gbl...>>> Certainly
>>
>> Imports System.Web.Services
>> Imports System.Web.Services.Protocols
>>
>> ' Define a SOAP header by deriving from the SoapHeader
>> base class.
>> Public Class StartUpParamaters : Inherits SoapHeader
>> Public IsDegug As Boolean
>> Public Sub New()
>> '
>> '
>> '
>> End Sub
>> End Class
>>
>>
>> <WebService(Namespace:="http://myserver.mydomain.com/")>> Public Class Manager
>> Inherits System.Web.Services.WebService
>>
>> Public oHead as StartUpParamaters
>>
>> <WebMethod(EnableSession:=True), SoapHeader
>> ("oHead",Direction := SoapHeaderDirection.In, _
>> Required := False))> Public Function Login(ByVal
>> UserName As String, ByVal Password As String) Ase.ToString>>
>> if oHead.IsDebug then
>> 'Write to trace log
>> end if
>> End Function
>> End Class
>>
>> 'Client
>>
>> Public Shared Sub Main()
>> Dim ws As New Manager()
>>
>> Try
>> Dim customHeader As New StartUpParamaters()
>>
>> customHeader.IsDebug = True
>>
>> ws.myHeader = customHeader
>>
>> Dim results As Integer
>>
>> results = ws.Login("UserName","Password")
>> Catch e As Exception
>> Console.WriteLine("Exception: {0}",help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebServices>> ())
>> End Try
>> End Sub
>>
>> ms-
>>help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebServices>> ProtocolsSoapHeaderClassMustUnderstandTopic.htm
>>
>> ms-
>>help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebServices>> ProtocolsSoapHeaderAttributeClassDirectionTopic.ht m
>>
>> ms-
>>me>> ProtocolsSoapHeaderAttributeClassRequiredTopic.htm
>>
>>
>> HTH
>>
>> Matthew
>>>> >-----Original Message-----
>> >I am not familiar with this idea.... Could you giveyou>> an example (or point>> message>> >me to one) ?
>> >
>> >I would really appreciate it !
>> >
>> >
>> >ThanX
>> >
>> >Bubba !
>> >
>> >
>> >"Matthew Holton" <mholton@americasdoctor.com> wrote in>> >news:056701c3db18$0c200930$a501280a@phx.gbl...
>> >> May I suggest an additional header, pass one in ifcan>> >> are in debug mode, and not if you are not.
>> >>
>> >> Class OptionalHeader : Inherits SoapHeader
>> >> Public DebugMode as boolean
>> >> End Class
>> >>
>> >>
>> >>
>> >> >-----Original Message-----
>> >> >Is there any way that the NEW() of a web servicethis>> set>> >> accept parameters ? I
>> >> >would like to pass a boolean to indicate to the
>> >> webservice that I am in test
>> >> >mode or live mode. This will give me the ability to>> >> up which Database I
>> >> >want to use on the back end. If I cannot do itparameter>> way>> has>> >> does anyone know of
>> >> >another way I can do it ? I have a WebService that>> >> about 75 procedures
>> >> >and I would rather not have to submit this=>> >> into every one of them.
>> >> >
>> >> >I would like to do something like this :
>> >> >
>> >> >
>> >> >Private agentMonitorConnectionStringLive As String=>> >> >"uid=callManager;pwd=liveon070703;" &
>> >> >"database=callManager;server=129.110.10.235;Conne ct
>> >> Timeout=45"
>> >> >Private agentMonitorConnectionStringTest As String>"database=callManager;server=129.110.205.11;pooli ng='fals>>>> >> >"uid=callManager;pwd=callManager;" &
>> >>>>> >> e';Connect
>> >> >Timeout=45"
>> >> >Private queueMessagesConnectionLive As String =
>> >> >"uid=FrontOffice;pwd=liveon070703;" &
>> >> >"database=FrontOffice;server=129.110.10.235;Conne ct
>> >> Timeout=45"
>> >> >Private queueMessagesConnectionTest As String =
>> >> >"uid=FrontOffice;pwd=FrontOffice;" &
>> >> >"database=FrontOffice;server=129.110.205.11;Conne ct
>> >> Timeout=45"
>> >> >Public agentMonitorConnectionString As String
>> >> >Public queueMessagesConnectionString As String
>> >> >
>> >> >Public Sub New(ByVal LiveMode As Boolean)
>> >> >
>> >> > If LiveMode Then
>> >> > agentMonitorConnectionString =
>> >> agentMonitorConnectionStringLive
>> >> > queueMessagesConnectionString =
>> >> queueMessagesConnectionLive
>> >> > Else
>> >> > agentMonitorConnectionString =
>> >> agentMonitorConnectionStringTest
>> >> > queueMessagesConnectionString =
>> >> queueMessagesConnectionTest
>> >> > End If
>> >> >
>> >> >End Sub
>> >> >
>> >> >
>> >> >
>> >> >TIA !
>> >> >
>> >> >
>> >> >Bubba !
>> >> >
>> >> >
>> >> >.
>> >> >
>> >
>> >
>> >.
>> >
>
>.
>Guest



Reply With Quote

