By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 2,356 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Dynamic URL Behavior & Configuration

P: n/a
We have an application converted from v1.1 Framework to v2.0. The executable
references a class library which in turn has a web reference. The web
reference 'URL Behavior' is set to dynamic. We added an entry to the
executable's .exe.config file to specify the URL, and under the 1.1 framework
this worked well. Unfortunately, this is not working under the 2.0 framework.

I see in the Reference.cs file under the web service reference the following
code:

this.Url = global::ClassLibraryName.Properties.Settings.Defau lt.WebServiceName

and I see in Settings.settings in the class library an entry for the web
service. Applications deployed under v2.0 are indeed using the URL specified
in Settings.settings.

It looks to me as if the web reference is no longer using the exe.config
file to pick up the url for the web service, and it is not clear to me what
file needs to be modified when the application is deployed to specify the
location of the URL for that deployment.

How should web references be configured to allow dynamic specification of
their URL, and which deployed files need to be altered to specify the URL?

Thank you,
Mike

Jan 25 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Hi Mike,

Welcome to MSDN newsgroup.
Regarding on the Webservice proxy with dynamic URL behavior's url string
stroage question, based on my understanding, in vs 2005/.NET 2.0 project,
we still persist the URL string for dynamic behavior webservice proxy in
application config file (app.config or web.config....). yes, .NET 2.0
class library or desktop app project(winform or console) do use a new
AppSettings class to store and retrieve such configuration info (like
webservice url string , connection string....). However, if we dig into
that appsettings class's code, we'll find that will also point to the
application configuration file (app.config ) underlyingly. So for your
scenario, when you add a web reference in class library project, you'll
find that the class library will add a app.config file in it which has the
entry that store the URL string (if using Dynamic Behavior). So when we
deploy the class library assembly(add referece to it ) in target client
application(winform, asp.net ,or console...), we can just override (or just
copy) the setting in our class library project's app.config to the target
application 's application config file (app.config or web.config...)

Hope this helps. Thanks,

Steven Cheng
Microsoft Online Support

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

--------------------
Thread-Topic: Dynamic URL Behavior & Configuration
thread-index: AcYiBL/X/vTGsN4ITVe0D7o2pLoP6A==
X-WBNR-Posting-Host: 209.77.204.49
From: "=?Utf-8?B?TWlrZSBMaXZlbnNwYXJnYXI=?=" <wa******@newsgroups.nospam>
Subject: Dynamic URL Behavior & Configuration
Date: Wed, 25 Jan 2006 15:12:02 -0800
Lines: 28
Message-ID: <19**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
microsoft.public.dotnet.framework.webservices:1347 2
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

We have an application converted from v1.1 Framework to v2.0. The
executable
references a class library which in turn has a web reference. The web
reference 'URL Behavior' is set to dynamic. We added an entry to the
executable's .exe.config file to specify the URL, and under the 1.1
framework
this worked well. Unfortunately, this is not working under the 2.0
framework.

I see in the Reference.cs file under the web service reference the
following
code:

this.Url =
global::ClassLibraryName.Properties.Settings.Defau lt.WebServiceName

and I see in Settings.settings in the class library an entry for the web
service. Applications deployed under v2.0 are indeed using the URL
specified
in Settings.settings.

It looks to me as if the web reference is no longer using the exe.config
file to pick up the url for the web service, and it is not clear to me what
file needs to be modified when the application is deployed to specify the
location of the URL for that deployment.

How should web references be configured to allow dynamic specification of
their URL, and which deployed files need to be altered to specify the URL?

Thank you,
Mike


Jan 26 '06 #2

P: n/a
Thank you, Steven. Given your response I looked in the app.config file in the
class library project and found the <applicationSettings> and associated
section handler entry in <configSections>. I copied those into the
executables .config file and now all is working as planned.

Mike

"Steven Cheng[MSFT]" wrote:
Hi Mike,

Welcome to MSDN newsgroup.
Regarding on the Webservice proxy with dynamic URL behavior's url string
stroage question, based on my understanding, in vs 2005/.NET 2.0 project,
we still persist the URL string for dynamic behavior webservice proxy in
application config file (app.config or web.config....). yes, .NET 2.0
class library or desktop app project(winform or console) do use a new
AppSettings class to store and retrieve such configuration info (like
webservice url string , connection string....). However, if we dig into
that appsettings class's code, we'll find that will also point to the
application configuration file (app.config ) underlyingly. So for your
scenario, when you add a web reference in class library project, you'll
find that the class library will add a app.config file in it which has the
entry that store the URL string (if using Dynamic Behavior). So when we
deploy the class library assembly(add referece to it ) in target client
application(winform, asp.net ,or console...), we can just override (or just
copy) the setting in our class library project's app.config to the target
application 's application config file (app.config or web.config...)

Hope this helps. Thanks,

Steven Cheng
Microsoft Online Support

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

--------------------
Thread-Topic: Dynamic URL Behavior & Configuration
thread-index: AcYiBL/X/vTGsN4ITVe0D7o2pLoP6A==
X-WBNR-Posting-Host: 209.77.204.49
From: "=?Utf-8?B?TWlrZSBMaXZlbnNwYXJnYXI=?=" <wa******@newsgroups.nospam>
Subject: Dynamic URL Behavior & Configuration
Date: Wed, 25 Jan 2006 15:12:02 -0800
Lines: 28
Message-ID: <19**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:1347 2
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

We have an application converted from v1.1 Framework to v2.0. The
executable
references a class library which in turn has a web reference. The web
reference 'URL Behavior' is set to dynamic. We added an entry to the
executable's .exe.config file to specify the URL, and under the 1.1
framework
this worked well. Unfortunately, this is not working under the 2.0
framework.

I see in the Reference.cs file under the web service reference the
following
code:

this.Url =
global::ClassLibraryName.Properties.Settings.Defau lt.WebServiceName

and I see in Settings.settings in the class library an entry for the web
service. Applications deployed under v2.0 are indeed using the URL
specified
in Settings.settings.

It looks to me as if the web reference is no longer using the exe.config
file to pick up the url for the web service, and it is not clear to me what
file needs to be modified when the application is deployed to specify the
location of the URL for that deployment.

How should web references be configured to allow dynamic specification of
their URL, and which deployed files need to be altered to specify the URL?

Thank you,
Mike

Jan 26 '06 #3

P: n/a
You're welcome.

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.)
--------------------
Thread-Topic: Dynamic URL Behavior & Configuration
thread-index: AcYilF1YQnypYsFySsWvL78NqSxC/w==
X-WBNR-Posting-Host: 209.77.204.49
From: "=?Utf-8?B?TWlrZSBMaXZlbnNwYXJnYXI=?=" <wa******@newsgroups.nospam>
References: <19**********************************@microsoft.co m>
<KR**************@TK2MSFTNGXA02.phx.gbl>
Subject: RE: Dynamic URL Behavior & Configuration
Date: Thu, 26 Jan 2006 08:20:04 -0800
Lines: 102
Message-ID: <10**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGXA03.phx.gbl
microsoft.public.dotnet.framework.webservices:1348 3
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Thank you, Steven. Given your response I looked in the app.config file in
the
class library project and found the <applicationSettings> and associated
section handler entry in <configSections>. I copied those into the
executables .config file and now all is working as planned.

Mike

"Steven Cheng[MSFT]" wrote:
Hi Mike,

Welcome to MSDN newsgroup.
Regarding on the Webservice proxy with dynamic URL behavior's url string
stroage question, based on my understanding, in vs 2005/.NET 2.0 project,
we still persist the URL string for dynamic behavior webservice proxy in
application config file (app.config or web.config....). yes, .NET 2.0
class library or desktop app project(winform or console) do use a new
AppSettings class to store and retrieve such configuration info (like
webservice url string , connection string....). However, if we dig into
that appsettings class's code, we'll find that will also point to the
application configuration file (app.config ) underlyingly. So for your
scenario, when you add a web reference in class library project, you'll
find that the class library will add a app.config file in it which has the entry that store the URL string (if using Dynamic Behavior). So when we
deploy the class library assembly(add referece to it ) in target client
application(winform, asp.net ,or console...), we can just override (or just copy) the setting in our class library project's app.config to the target
application 's application config file (app.config or web.config...)

Hope this helps. Thanks,

Steven Cheng
Microsoft Online Support

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

--------------------
Thread-Topic: Dynamic URL Behavior & Configuration
thread-index: AcYiBL/X/vTGsN4ITVe0D7o2pLoP6A==
X-WBNR-Posting-Host: 209.77.204.49
From: "=?Utf-8?B?TWlrZSBMaXZlbnNwYXJnYXI=?=" <wa******@newsgroups.nospam>
Subject: Dynamic URL Behavior & Configuration
Date: Wed, 25 Jan 2006 15:12:02 -0800
Lines: 28
Message-ID: <19**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:1347 2
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

We have an application converted from v1.1 Framework to v2.0. The
executable
references a class library which in turn has a web reference. The web
reference 'URL Behavior' is set to dynamic. We added an entry to the
executable's .exe.config file to specify the URL, and under the 1.1
framework
this worked well. Unfortunately, this is not working under the 2.0
framework.

I see in the Reference.cs file under the web service reference the
following
code:

this.Url =
global::ClassLibraryName.Properties.Settings.Defau lt.WebServiceName

and I see in Settings.settings in the class library an entry for the web
service. Applications deployed under v2.0 are indeed using the URL
specified
in Settings.settings.

It looks to me as if the web reference is no longer using the exe.config
file to pick up the url for the web service, and it is not clear to me what file needs to be modified when the application is deployed to specify the
location of the URL for that deployment.

How should web references be configured to allow dynamic specification of
their URL, and which deployed files need to be altered to specify the URL?

Thank you,
Mike


Jan 27 '06 #4

P: 2
I have/had the same problem going from 1.1 to 2.0. My situation is very similar to this problem. In my case I have several .NET remoting objects being hosted by IIS. The remoting classes are in separate class libs (and VS 2005 projects) and these classes DO reference webservices.

I do get the fact that I have to copy the classlib.dll.config settings to the web.config hosting app (the virtual directory hosting remoting objs) for each of my class libs that is compiled into a separate assembly. I guess I'm asking why? This is a maintenance problem as I have to copy settings from one config to another and "weave" them into the hosting application (whether that be a website or windows app).

The above do work, but still asking why this way?

Is this really what Microsoft intended developers to do? There must be a better way.

Jim
May 8 '06 #5

P: 1
Hi

I am doing a similar thing, except that my class library is being referenced by a web app. I understand that the the settings need to be in the web.config file, but I can't work out where to put the <applicationSettings> element, or the settings in it.

I have tried
<appSettings>
<add key="webserviceName" value="url"/>
</appSettings>

and also copying the <applicationSettings> and <configSections> into the web.config, but the webservice is still using the settings in the Settings file.


Any help would be appreciated.
Jul 20 '06 #6

P: 1
I am having the same problem.
I have a project that hits a web service. I need to include it in 2 web projects and a console app. We have a test and production environment, so I need to be able to change a config setting in the production environment to use the correct web service.
However, changing the app.config location in the project with the web service does not work. Neither does adding this setting to the app.config of the console app, or the web.config of the web projects. It seems the only setting I can change that will work is the settings file (in properties folder) of the project with the web service, however, this is not a good option as it requires a different compile for production than testing. Any changes between the two environments need to be accomplished with configuration settings, no compiles.

Hopefully someone has some insight on this... I haven't been able to find too much, because it seems most people are using the web service in their end project directly, not another project reference, in which case the "dynamic" setting works as expected.
Jul 28 '06 #7

P: n/a
Hi,

I have a 3rd party web service running in a Web Server within our network.
The web service sends "Hello" message when joins the network and also sends
"Bye" message when leaves the network.
I want to write a client code to receive the "Hello" message as well as the
"Bye" message sent by the web service.
Can you please suggest me a sample code, so that I can discover (dynamically
discover) the web service using the multicast discovery protocol (using
WS-Discovery).

Development Environment : VS 2005, .NET 2.0 and WSE 3.0

Thanks in Advance
--
Thanks & Regards,
John Paul. A
MCAD
"Steven Cheng[MSFT]" wrote:
You're welcome.

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.)
--------------------
Thread-Topic: Dynamic URL Behavior & Configuration
thread-index: AcYilF1YQnypYsFySsWvL78NqSxC/w==
X-WBNR-Posting-Host: 209.77.204.49
From: "=?Utf-8?B?TWlrZSBMaXZlbnNwYXJnYXI=?=" <wa******@newsgroups.nospam>
References: <19**********************************@microsoft.co m>
<KR**************@TK2MSFTNGXA02.phx.gbl>
Subject: RE: Dynamic URL Behavior & Configuration
Date: Thu, 26 Jan 2006 08:20:04 -0800
Lines: 102
Message-ID: <10**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:1348 3
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Thank you, Steven. Given your response I looked in the app.config file in
the
class library project and found the <applicationSettingsand associated
section handler entry in <configSections>. I copied those into the
executables .config file and now all is working as planned.

Mike

"Steven Cheng[MSFT]" wrote:
Hi Mike,

Welcome to MSDN newsgroup.
Regarding on the Webservice proxy with dynamic URL behavior's url string
stroage question, based on my understanding, in vs 2005/.NET 2.0 project,
we still persist the URL string for dynamic behavior webservice proxy in
application config file (app.config or web.config....). yes, .NET 2.0
class library or desktop app project(winform or console) do use a new
AppSettings class to store and retrieve such configuration info (like
webservice url string , connection string....). However, if we dig into
that appsettings class's code, we'll find that will also point to the
application configuration file (app.config ) underlyingly. So for your
scenario, when you add a web reference in class library project, you'll
find that the class library will add a app.config file in it which has
the
entry that store the URL string (if using Dynamic Behavior). So when we
deploy the class library assembly(add referece to it ) in target client
application(winform, asp.net ,or console...), we can just override (or
just
copy) the setting in our class library project's app.config to the target
application 's application config file (app.config or web.config...)

Hope this helps. Thanks,

Steven Cheng
Microsoft Online Support

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

--------------------
Thread-Topic: Dynamic URL Behavior & Configuration
thread-index: AcYiBL/X/vTGsN4ITVe0D7o2pLoP6A==
X-WBNR-Posting-Host: 209.77.204.49
From: "=?Utf-8?B?TWlrZSBMaXZlbnNwYXJnYXI=?=" <wa******@newsgroups.nospam>
Subject: Dynamic URL Behavior & Configuration
Date: Wed, 25 Jan 2006 15:12:02 -0800
Lines: 28
Message-ID: <19**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:1347 2
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

We have an application converted from v1.1 Framework to v2.0. The
executable
references a class library which in turn has a web reference. The web
reference 'URL Behavior' is set to dynamic. We added an entry to the
executable's .exe.config file to specify the URL, and under the 1.1
framework
this worked well. Unfortunately, this is not working under the 2.0
framework.

I see in the Reference.cs file under the web service reference the
following
code:

this.Url =
global::ClassLibraryName.Properties.Settings.Defau lt.WebServiceName

and I see in Settings.settings in the class library an entry for the web
service. Applications deployed under v2.0 are indeed using the URL
specified
in Settings.settings.

It looks to me as if the web reference is no longer using the exe.config
file to pick up the url for the web service, and it is not clear to me
what
file needs to be modified when the application is deployed to specify the
location of the URL for that deployment.

How should web references be configured to allow dynamic specification of
their URL, and which deployed files need to be altered to specify the URL?

Thank you,
Mike


Oct 22 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.