No Touch Deployment and Web Services.

Discussion in 'ASP .Net Web Services' started by Mats-Erik Grundh, Oct 15, 2003.

  1. No Touch Deployment and Web Services.

    How do you programatically configure wich server to
    access?

    My environment:
    - Locahost.
    - Test server.
    - Production server.

    My problem is that same webservice deploys on localhosts,
    development server, test server and production server and
    i want to control from the shortcut on the desktop, or
    som other way, on
    which server to access webservice from, like this:

    C:\WINNT\Microsoft.NET\Framework\v1.1.4322\IEExec.exe
    http://ozzy/conet/client/bin/co.win.exe?server=ozzy

    the parameter server=ozzy tells which server to run
    webservice on.

    PS:I've tested the option dynamic on web reference
    properties but i cant find a way to programatically
    change
    the settings in application.config file.

    Thanks in advance!
     
    Mats-Erik Grundh, Oct 15, 2003
    #1
    1. Advertising

  2. On your client application use the url property of the generated proxy,
    like:

    public class Math : System.Web.Services.Protocols.SoapHttpClientProtocol
    ..... (Generated by Reference import)


    your app:

    Math m=new Math();
    m.Url="your url here"

    ...

    m.YourRemoteMethod();

    best regards
    ricardo


    "Mats-Erik Grundh" <> wrote in message
    news:094701c39326$68f2d190$...
    > No Touch Deployment and Web Services.
    >
    > How do you programatically configure wich server to
    > access?
    >
    > My environment:
    > - Locahost.
    > - Test server.
    > - Production server.
    >
    > My problem is that same webservice deploys on localhosts,
    > development server, test server and production server and
    > i want to control from the shortcut on the desktop, or
    > som other way, on
    > which server to access webservice from, like this:
    >
    > C:\WINNT\Microsoft.NET\Framework\v1.1.4322\IEExec.exe
    > http://ozzy/conet/client/bin/co.win.exe?server=ozzy
    >
    > the parameter server=ozzy tells which server to run
    > webservice on.
    >
    > PS:I've tested the option dynamic on web reference
    > properties but i cant find a way to programatically
    > change
    > the settings in application.config file.
    >
    > Thanks in advance!
    >
     
    Ricardo Pereira, Oct 15, 2003
    #2
    1. Advertising

  3. I don't think it's a possible solution beacause we have a
    huge application with many calls to different webservices
    (on same server) and i'ts not reliable to use the URL
    property in your code if the developer forgot to write the
    url before the call.

    >-----Original Message-----
    >On your client application use the url property of the

    generated proxy,
    >like:
    >
    > public class Math :

    System.Web.Services.Protocols.SoapHttpClientProtocol
    >..... (Generated by Reference import)
    >
    >
    >your app:
    >
    >Math m=new Math();
    >m.Url="your url here"
    >
    >...
    >
    >m.YourRemoteMethod();
    >
    >best regards
    >ricardo
    >
    >
    >"Mats-Erik Grundh" <> wrote in message
    >news:094701c39326$68f2d190$...
    >> No Touch Deployment and Web Services.
    >>
    >> How do you programatically configure wich server to
    >> access?
    >>
    >> My environment:
    >> - Locahost.
    >> - Test server.
    >> - Production server.
    >>
    >> My problem is that same webservice deploys on

    localhosts,
    >> development server, test server and production server

    and
    >> i want to control from the shortcut on the desktop, or
    >> som other way, on
    >> which server to access webservice from, like this:
    >>
    >> C:\WINNT\Microsoft.NET\Framework\v1.1.4322\IEExec.exe
    >> http://ozzy/conet/client/bin/co.win.exe?server=ozzy
    >>
    >> the parameter server=ozzy tells which server to run
    >> webservice on.
    >>
    >> PS:I've tested the option dynamic on web reference
    >> properties but i cant find a way to programatically
    >> change
    >> the settings in application.config file.
    >>
    >> Thanks in advance!
    >>

    >
    >
    >.
    >
     
    Mats-Erik Grundh, Oct 16, 2003
    #3
  4. You may modify the config file before call the web service, for example:

    Dim doc As New XmlDocument

    doc.Load("WindowsApplication2.exe.config")

    Dim n As XmlNode

    n =
    doc.DocumentElement.SelectSingleNode("/configuration/appSettings/add[@key='W
    indowsApplication2.localhost.Service1'] ")



    n.Attributes(1).InnerXml =
    "http://AppServer/WebService1/Service1.asmx"

    doc.Save("WindowsApplication2.exe.config")

    doc = Nothing

    Dim o As New localhost.Service1

    MsgBox(o.GetString)


    This will change the web service's url dynamically.

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    ¥xÆW·L³n§Þ³N³B¤ä´©³¡, Oct 16, 2003
    #4
  5. Thanks, but how do i get access to the app.config file
    when i use "No Touch Deployment" like:

    ...\Framework\v1.1.4322\IEExec.exe http://server/my.app.exe

    /Mats-Erik

    >-----Original Message-----
    >You may modify the config file before call the web

    service, for example:
    >
    > Dim doc As New XmlDocument
    >
    > doc.Load("WindowsApplication2.exe.config")
    >
    > Dim n As XmlNode
    >
    > n =
    >doc.DocumentElement.SelectSingleNode

    ("/configuration/appSettings/add[@key='W
    >indowsApplication2.localhost.Service1'] ")
    >
    >
    >
    > n.Attributes(1).InnerXml =
    >"http://AppServer/WebService1/Service1.asmx"
    >
    > doc.Save("WindowsApplication2.exe.config")
    >
    > doc = Nothing
    >
    > Dim o As New localhost.Service1
    >
    > MsgBox(o.GetString)
    >
    >
    >This will change the web service's url dynamically.
    >
    >Luke
    >Microsoft Online Support
    >
    >Get Secure! www.microsoft.com/security
    >(This posting is provided "AS IS", with no warranties,

    and confers no
    >rights.)
    >
    >.
    >
     
    Mats-Erik Grundh, Oct 20, 2003
    #5
  6. Mats-Erik Grundh

    MSFT Guest

    Then you may try to set the web service's url property, for example:

    Dim o As New Server1.Service1

    o.Url = "http://Server2/WebService1/Service1.asmx"

    MsgBox(o.GetString)

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    MSFT, Oct 21, 2003
    #6
  7. I don't think it's a possible solution beacause we have a
    huge application with many calls to different webservices
    (on same server) and i'ts not reliable to use the URL
    property in your code if the developer forgot to write the
    url before the call.

    "MSFT" <> wrote in message
    news:...
    > Then you may try to set the web service's url property, for example:
    >
    > Dim o As New Server1.Service1
    >
    > o.Url = "http://Server2/WebService1/Service1.asmx"
    >
    > MsgBox(o.GetString)
    >
    > Luke
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
     
    Mats-Erik Grundh, Oct 21, 2003
    #7
  8. Mats-Erik Grundh

    MSFT Guest

    When we redirect a web service, there may two ways:

    1. Modify its url in code
    2. Specify its url in config file.

    Since your appliaction was executed thhorugh IEexec, it is hard to modify
    config file on the web server. Therefore, the only resort is achieving this
    in code. If we have a better design in the code, for example, when
    developer need to call a web service, he need to call a public method:


    Dim webobj= GetWebServiceObject()

    Public Function GetWebServiceObject() as Server1.Service1


    Dim o As New Server1.Service1
    o.Url = strWebServiceUrl

    return o

    End Function

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    MSFT, Oct 22, 2003
    #8
  9. Mats-Erik Grundh

    Ken Guest

    > Source File:
    > c:\windows\microsoft.net\framework\v1.1.4322\Config\machine.config

    Line:
    > 258

    <add
    > assembly="*"/>

    "MSFT" <> wrote in message
    news:...
    > When we redirect a web service, there may two ways:
    >
    > 1. Modify its url in code
    > 2. Specify its url in config file.
    >
    > Since your appliaction was executed thhorugh IEexec, it is hard to modify
    > config file on the web server. Therefore, the only resort is achieving

    this
    > in code. If we have a better design in the code, for example, when
    > developer need to call a web service, he need to call a public method:
    >
    >
    > Dim webobj= GetWebServiceObject()
    >
    > Public Function GetWebServiceObject() as Server1.Service1
    >
    >
    > Dim o As New Server1.Service1
    > o.Url = strWebServiceUrl
    >
    > return o
    >
    > End Function
    >
    > Luke
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
     
    Ken, Oct 22, 2003
    #9
  10. What is the purpose of adding assembly="*" in machine.config?


    "Ken" <> wrote in message
    news:...
    > > Source File:
    > > c:\windows\microsoft.net\framework\v1.1.4322\Config\machine.config

    > Line:
    > > 258

    > <add
    > > assembly="*"/>

    > "MSFT" <> wrote in message
    > news:...
    > > When we redirect a web service, there may two ways:
    > >
    > > 1. Modify its url in code
    > > 2. Specify its url in config file.
    > >
    > > Since your appliaction was executed thhorugh IEexec, it is hard to

    modify
    > > config file on the web server. Therefore, the only resort is achieving

    > this
    > > in code. If we have a better design in the code, for example, when
    > > developer need to call a web service, he need to call a public method:
    > >
    > >
    > > Dim webobj= GetWebServiceObject()
    > >
    > > Public Function GetWebServiceObject() as Server1.Service1
    > >
    > >
    > > Dim o As New Server1.Service1
    > > o.Url = strWebServiceUrl
    > >
    > > return o
    > >
    > > End Function
    > >
    > > Luke
    > > Microsoft Online Support
    > >
    > > Get Secure! www.microsoft.com/security
    > > (This posting is provided "AS IS", with no warranties, and confers no
    > > rights.)
    > >

    >
    >
     
    Mats-Erik Grundh, Oct 22, 2003
    #10
  11. Mats-Erik Grundh

    MSFT Guest

    This message may be posted incorrectly by KEN. From his information, it is
    not related to this topic.

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    MSFT, Oct 27, 2003
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mats-Erik Grundh

    No Touch Deployment and Web Services.

    Mats-Erik Grundh, Sep 30, 2003, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    123
    Mats-Erik Grundh
    Oct 2, 2003
  2. Mats-Erik Grundh

    No Touch Deployment and Web Services.

    Mats-Erik Grundh, Oct 4, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    141
    Mats-Erik Grundh
    Oct 4, 2003
  3. Mats-Erik Grundh

    No Touch Deployment and Web Services.

    Mats-Erik Grundh, Oct 14, 2003, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    127
    Mats-Erik Grundh
    Oct 17, 2003
  4. Mats-Erik Grundh

    No Touch Deployment and Web Services.

    Mats-Erik Grundh, Oct 16, 2003, in forum: ASP .Net Web Services
    Replies:
    7
    Views:
    131
    Sami Vaaraniemi
    Oct 25, 2003
  5. Han Holl
    Replies:
    4
    Views:
    347
    Nobuyoshi Nakada
    Oct 12, 2006
Loading...

Share This Page