|
-
Jun 23rd, 2004, 07:06 AM
#1
Thread Starter
Frenzied Member
How to handle web references???
In my C/S project I have a webservice running on an application server... ICurrently only at test server
Now I want to move my application to production, which is the best way to switch the webreferences from host "server_test" to "server_prod"? I mean, for every object I create which has webmethods I basically write
dim t as new server_test.calculator
dim res as integer
res = calculator.subtract(4,6)
Let's say I have a few 100 references to server_test in my solution, now I want to move this to host server_prod... How can I handle my application so it will change references to the service at server_prod instead? Which is the best way to do this????
In my solution explorer I have added web references to server_test.. should I also add reference to server_prod, or should I create a separate solution for prod????
kind regards
Henrik
-
Jun 24th, 2004, 12:06 AM
#2
Select the web reference then go to it's properties and set the URL Behavior property to Dynamic. This will create an entry in the app.config file. The web service will also now use the URL in the app.config file and thus can be easily changed.
-
Jun 24th, 2004, 12:08 AM
#3
Thread Starter
Frenzied Member
Gee, thanks! I have read at least two vb.net books including webservices, and neither of them have told me about this simple feature...!! Thanks!
Henrik
-
Jun 24th, 2004, 01:09 AM
#4
Thread Starter
Frenzied Member
One odd thing though... if I in my dev environment have the references at locahost, and then change to test or prod, the localhost name remains, but the underlying reference can be changed. This can be somewhat confusing if it in the code says
dim t as localhost.service1
but in the app.config says:
<appSettings><add key="winapp.localhost.service1" value="http://prodserver/service1/proj_service.asmx"/></appSettings></configuration>
kind regards
Henrik
-
Jun 24th, 2004, 10:41 PM
#5
You can change it if you want. See the IDE just makes a wrapper class to work with the web service and by default it names it something similiar to the address even though it in no way relates to the actual address. I believe you can change it when setting the reference or at any time after by just editing the code that the IDE created. You should be able to reach it if you double click the class in the object viewer or maybe from the class explorer. The important thing to remember is that it is just a name.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|