Passing Parameters into NEW()

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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
    4. 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,...
    5. 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...
  3. #2

    Default 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...
    > 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 !
    >
    >

    Jan Tielens Guest

  4. #3

    Default 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...
    > 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 !
    >
    >

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

  5. #4

    Default 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


    >-----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 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;Conne ct
    Timeout=45"
    >Private agentMonitorConnectionStringTest As String =
    >"uid=callManager;pwd=callManager;" &
    >"database=callManager;server=129.110.205.11;pooli ng='fals
    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 !
    >
    >
    >.
    >
    Matthew Holton Guest

  6. #5

    Default 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...
    > 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...
    > > 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 !
    > >
    > >
    >
    >
    > ---
    > 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

  7. #6

    Default 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
    >
    >
    >
    > >-----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 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;Conne ct
    > Timeout=45"
    > >Private agentMonitorConnectionStringTest As String =
    > >"uid=callManager;pwd=callManager;" &
    > >"database=callManager;server=129.110.205.11;pooli ng='fals
    > 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

  8. #7

    Default 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
    >-----Original Message-----
    >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
    >>
    >>
    >>
    >> >-----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
    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;Conne ct
    >> Timeout=45"
    >> >Private agentMonitorConnectionStringTest As String =
    >> >"uid=callManager;pwd=callManager;" &
    >>
    >"database=callManager;server=129.110.205.11;pooli ng='fals
    >> 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 !
    >> >
    >> >
    >> >.
    >> >
    >
    >
    >.
    >
    Matthew Holton Guest

  9. #8

    Default 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
    >
    > >-----Original Message-----
    > >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
    > >>
    > >>
    > >>
    > >> >-----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
    > 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;Conne ct
    > >> Timeout=45"
    > >> >Private agentMonitorConnectionStringTest As String =
    > >> >"uid=callManager;pwd=callManager;" &
    > >>
    > >"database=callManager;server=129.110.205.11;pooli ng='fals
    > >> 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

  10. #9

    Default 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
    >
    > >-----Original Message-----
    > >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
    > >>
    > >>
    > >>
    > >> >-----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
    > 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;Conne ct
    > >> Timeout=45"
    > >> >Private agentMonitorConnectionStringTest As String =
    > >> >"uid=callManager;pwd=callManager;" &
    > >>
    > >"database=callManager;server=129.110.205.11;pooli ng='fals
    > >> 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

  11. #10

    Default Re: Passing Parameters into NEW()

    You are correct.
    >-----Original Message-----
    >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
    >>
    >> >-----Original Message-----
    >> >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
    >> >>
    >> >>
    >> >>
    >> >> >-----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
    >> 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;Conne ct
    >> >> Timeout=45"
    >> >> >Private agentMonitorConnectionStringTest As String
    =
    >> >> >"uid=callManager;pwd=callManager;" &
    >> >>
    >>
    >"database=callManager;server=129.110.205.11;pooli ng='fals
    >> >> 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139