all groups > dotnet distributed apps > march 2004 >
You're in the

dotnet distributed apps

group:

Using Web Service In Real Life



Using Web Service In Real Life GCeaser NO[at]SPAM aol.com
3/9/2004 9:49:59 AM
dotnet distributed apps: OK,

So here is my question.... If I understand correctly, when you
add a Web Reference to a VS.NEt project, it includes the exact URL
(via the WSDL or DISCO -forget which) where the web service should be
executed from in real life, while developing an application, the exact
location of the web server would change. For example, as your
application migrates from its Development Environment to is
functional qualification testing (FQT) environment, there would be a
different web server hosting the Web Service and likewise when
migrating from FQT to Production or any other environment.

What is that standard approach for handling such cases in real
life?

Thanks
Re: Using Web Service In Real Life Ken Onweller (.NET MCSD)
3/9/2004 1:00:47 PM
when it comes to invoking a webservice you either do it from something on
the web
or something on a client.

for web-based clients i made the assumption that the IIS machine hosting the
web app would
be the same one hosting the webservice. thus, I only needed to change the
machine name in the
webservice proxy's URL property.

for clients, I retrieved the name of the IIS machine from a specific
database table where it was
being stored and used this to modify that proxy's URL property as well.

There is another approach I've not even looked into yet using discovery
where you have the
contract and then scan your LAN for any network machines exposing that very
self-same interface
and using it. Hopefully someone else reading these posts will have more
info to add concerning
this approach.


[quoted text, click to view]

Re: Using Web Service In Real Life Jason
3/10/2004 9:31:11 AM
2 ways:

In the Solution Explorer, right click the web reference and go to the
properties. It will have a URL Properties which is Static by default.
Change it to dynamic and a new file will be created called
<projectname>.<exe>.config. This is an xml file and needs to be distributed
with the project output.

Store the url somewhere else and set the Url property of the
SoapHttpClientProtocol dervided class before using it eg

Service1 svr = new Service1();
svr.Url = "";
svr.CallMethod();

Hope this helps.

Jason.

[quoted text, click to view]

AddThis Social Bookmark Button