dynamic WebServices

Discussion in 'ASP .Net Web Services' started by Chankas, Nov 17, 2003.

  1. Chankas

    Chankas Guest

    Hi everybody. I've developed an easy WebService with VStudio. I've developed
    too a little Web application with VB.NET and I've created a WebReference in
    order to use the WebService.

    My question is: How can I especify that my Webapplication use the WebService
    from other Web Server (nor localhot neither 127.0.0.1) without re-compile
    it???


    Thanks in advance and excuse muy English.

    Chankas.
     
    Chankas, Nov 17, 2003
    #1
    1. Advertising

  2. Chankas

    Manni Guest

    My English is not better then yours....(Austria) :)

    If you just want to change the URI for the the Service....
    This is a property, you can change it after creating the object.

    TheSvcNs.MySvc sVC=new ........
    sVC.Url=http://newServer.new.domain/other/path/someFile.asmx;

    I do things like this in a project where we have a "master server", and some
    "customer servers" (if the customer has it's own).

    First is a call to the master (with credentials for the customer); form this
    we get the
    path to the customer server.
    Next we split our paths (since we use different *,asmx) and replace the
    servername
    for every proxy with the new one!!

    We don't store the path - the masterserver must tell it allways (licensing,
    dynamic server changing).

    HTH

    Manfred
     
    Manni, Nov 17, 2003
    #2
    1. Advertising

  3. Chankas

    Chankas Guest

    Thanks Manni for your answer, but with this solution I'd have to recompile
    my client application and I just want avoid it.

    I've read some news where people explain that from VStudio enviroment it's
    posible to change the behavior of the Web Service to "dynamic" and after
    this I'd see in my config file a new entry where I could specify new ULR for
    the WService.

    I've just changed to "dinamyc" the behavior of my Web Reference and now I've
    a folder called "Web References" with a subfolder called as my WebService
    and inside it there're 4 files: WebService1.disco, WebService1.map,
    WebService1.wsdl and WebService1.vb.
    I've read this files and in all of them there're references to the URL of my
    Web Service. I suposse that changing some of these references I won't have
    to re-compile my client application.

    Is this right?? Which of the four files have I that modify??


    Thanks in advance. Chankas.

    "Manni" <> escribió en el mensaje
    news:...
    > My English is not better then yours....(Austria) :)
    >
    > If you just want to change the URI for the the Service....
    > This is a property, you can change it after creating the object.
    >
    > TheSvcNs.MySvc sVC=new ........
    > sVC.Url=http://newServer.new.domain/other/path/someFile.asmx;
    >
    > I do things like this in a project where we have a "master server", and

    some
    > "customer servers" (if the customer has it's own).
    >
    > First is a call to the master (with credentials for the customer); form

    this
    > we get the
    > path to the customer server.
    > Next we split our paths (since we use different *,asmx) and replace the
    > servername
    > for every proxy with the new one!!
    >
    > We don't store the path - the masterserver must tell it allways

    (licensing,
    > dynamic server changing).
    >
    > HTH
    >
    > Manfred
    >
    >
     
    Chankas, Nov 17, 2003
    #3
  4. Chankas

    Manni Guest

    Sorry I dont think your approach would help!

    But with my soultion you dont have to recompile!!!!!
    Otherwise the "autorecovery" would not work!!!!

    Assume, that you have a file (like you suggest), there your store the URL.
    So when you start your app - read the URL from the file,
    and store it somewhere common.
    Let's say you have a class CallHelper with a static Member m_strURL.
    If your webservices have more than one URL add more variables,
    and more lines to your file!!
    CallHelper reads the file (somewhere at the start of your programm) and
    remembers
    the URLs.

    Next replace every single line where you write
    MySvc.TheSvc svC=new svC();

    With
    MySvc.TheSvc svC=new svC();
    svC.Url=CallHelper.m_strURL;

    That is it - and don't have to recompile and so on!!
    OK, you have to recompile - one time, after you made those changes!!!
    But even with the change to "dynamic" you have that step to do since an
    other
    kind of proxy is generated!

    HTH

    Manfred



    "Chankas" <> schrieb im Newsbeitrag
    news:...
    > Thanks Manni for your answer, but with this solution I'd have to recompile
    > my client application and I just want avoid it.
    >
    > I've read some news where people explain that from VStudio enviroment it's
    > posible to change the behavior of the Web Service to "dynamic" and after
    > this I'd see in my config file a new entry where I could specify new ULR

    for
    > the WService.
    >
    > I've just changed to "dinamyc" the behavior of my Web Reference and now

    I've
    > a folder called "Web References" with a subfolder called as my WebService
    > and inside it there're 4 files: WebService1.disco, WebService1.map,
    > WebService1.wsdl and WebService1.vb.
    > I've read this files and in all of them there're references to the URL of

    my
    > Web Service. I suposse that changing some of these references I won't have
    > to re-compile my client application.
    >
    > Is this right?? Which of the four files have I that modify??
    >
    >
    > Thanks in advance. Chankas.
    >
    > "Manni" <> escribió en el mensaje
    > news:...
    > > My English is not better then yours....(Austria) :)
    > >
    > > If you just want to change the URI for the the Service....
    > > This is a property, you can change it after creating the object.
    > >
    > > TheSvcNs.MySvc sVC=new ........
    > > sVC.Url=http://newServer.new.domain/other/path/someFile.asmx;
    > >
    > > I do things like this in a project where we have a "master server", and

    > some
    > > "customer servers" (if the customer has it's own).
    > >
    > > First is a call to the master (with credentials for the customer); form

    > this
    > > we get the
    > > path to the customer server.
    > > Next we split our paths (since we use different *,asmx) and replace the
    > > servername
    > > for every proxy with the new one!!
    > >
    > > We don't store the path - the masterserver must tell it allways

    > (licensing,
    > > dynamic server changing).
    > >
    > > HTH
    > >
    > > Manfred
    > >
    > >

    >
    >
     
    Manni, Nov 18, 2003
    #4
    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. jib

    Webservices and OLE object

    jib, Jul 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    395
  2. Colt [MVP]
    Replies:
    1
    Views:
    395
    Nathan Baulch
    Jul 11, 2003
  3. David Waz...

    Re: Events in HTML throught webservices...

    David Waz..., Jul 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    382
    David Waz...
    Jul 11, 2003
  4. khawar
    Replies:
    0
    Views:
    447
    khawar
    Jul 15, 2003
  5. Stoney el frío

    Dynamic binding in webservices

    Stoney el frío, May 6, 2005, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    139
    Stoney el frío
    May 9, 2005
Loading...

Share This Page