473,385 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Web service address is changed

A.M
Hi,

I had a web server contained a web service.

We had to change the web server computer; so all client proxies must point
to new web server. My understanding is we have to compile all client
applications again.

We will probably change the address of web server in future again.

Is there any way that client applications programatically change the address
of web service in the proxy? I am thinking to have the address in
app.config, so we don't have to compile all client application any time that
we change the address of web server.

Thanks,

Alan


Nov 18 '05 #1
2 1229
Hi Alan:

In the Solution Explorer window, highlight the reference to the web
service under the Web References node, then view the properties.
Change the URL Behavior property from Static to Dynamic.

The web service proxy will now read the URL from web.config. Looking
in web.config you should see the IDE made an entry looking like:

<add key="WebApp.localhost.Service1"
value=http://server/WebService/Service1.asmx
/>

Now you can change the endpoint without a recompile.

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 8 Nov 2004 23:46:18 -0500, "A.M" <no*****@online.nospam>
wrote:
Hi,

I had a web server contained a web service.

We had to change the web server computer; so all client proxies must point
to new web server. My understanding is we have to compile all client
applications again.

We will probably change the address of web server in future again.

Is there any way that client applications programatically change the address
of web service in the proxy? I am thinking to have the address in
app.config, so we don't have to compile all client application any time that
we change the address of web server.

Thanks,

Alan


Nov 18 '05 #2
Thanks for Scott's suggestion.

Hi Alan,

As Scott has mentioned, we can dynamically change the webservice's client
proxy class's target url(asmx file's url). We can dig into the client proxy
class(WSDL.EXE generate for us)'s code, you'll find the class is something
like:

public class MyService :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {

/// <remarks/>
public MyService() {
this.Url = "http://sha-schang-01/myservice/myservice.asmx";
}
.......
And the "Url" property is just the one we need to update when the
webservice's deployment server changed.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb)....
0
by: pwilliams | last post by:
NCOALink Change of Address Verification Each year over 40 million Americans change their mailing addresses. This change is equivalent to every person in California deciding to change addresses...
2
by: Richard Collette | last post by:
Hi, I have a service, that runs perfectly when executed outside of the web service environment. When called as a web service I get the exception listed below sporadically. A call to the web...
2
by: Kim Floyd | last post by:
We have an application that uses .Net remoting to allow remote servers to connect to a master server to synchronize data. The format of the url we use to the master server looks like...
1
by: DLN | last post by:
Hello all, I'm running into a problem with one of our site's production web applications that was written in VB.net. The web app is running on W2K3/IIS6 and up until this afternoon, was working...
20
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
I was executing the steps given in http://suppor.microsoft.com/kb/308359 for testing a sample web service application. However, the following line gives a compilation error: localhost.Service1...
0
by: g-forsmo | last post by:
Hi! I am trying to implement a web service after a wsdl generated from BEA Web logic. I have used a tool called WSCF - Schema-Based Contract- First Web Services to generate a web service from a...
0
by: Jeova Almeida | last post by:
Hello, I created a simple web service for testing purpose in Visual Studio 2005: <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="WSTest" %> using System;
0
by: Jeova Almeida | last post by:
Hello, I created a simple web service for testing purpose in Visual Studio 2005: <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="WSTest" %> using System;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.