Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > dynamic WebServices

Reply
Thread Tools

dynamic WebServices

 
 
Chankas
Guest
Posts: n/a
 
      11-17-2003
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.


 
Reply With Quote
 
 
 
 
Manni
Guest
Posts: n/a
 
      11-17-2003
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


 
Reply With Quote
 
 
 
 
Chankas
Guest
Posts: n/a
 
      11-17-2003
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" <(E-Mail Removed)> escribió en el mensaje
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Manni
Guest
Posts: n/a
 
      11-18-2003
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" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> escribió en el mensaje
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic binding in webservices Stoney el frío ASP .Net Web Services 3 05-09-2005 12:01 PM
PIX 515 Can Ping Out-to-In but not any webservices getting out-to-in Johnny Davis Cisco 6 01-19-2004 05:33 PM
Re: Events in HTML throught webservices... David Waz... ASP .Net 0 07-11-2003 06:37 PM
Re: Events in HTML throught webservices... Colt [MVP] ASP .Net 1 07-11-2003 05:30 AM
Webservices and OLE object jib ASP .Net 0 07-08-2003 03:10 PM



Advertisments