Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > change Web References from web.config (or another solution?)

Reply
Thread Tools

change Web References from web.config (or another solution?)

 
 
ADingOD
Guest
Posts: n/a
 
      08-15-2003

Hi!

It's any solution to change the Web References when the application is
"moved" from "test" to "production" without a new compilation?

I mean to use one "set" of webservices when is running on "test" and
another "set" when is running on "production" without a recompilation.

Any manual edit of web.config, registry... is permited.

Thanks,
Alexandru
 
Reply With Quote
 
 
 
 
Lewis Wang [MSFT]
Guest
Posts: n/a
 
      08-18-2003
Hi Alexandru,

You can configure the web service to pull the URL based on a setting in a
configuration file, rather than a hardcoded value. To change the location,
simply change the config file with no recompile. Here is how to do it: Add
your web reference. Go to "Solution Explorer", right click on the web
reference name (eg. "localhost") and choose properties. In the property
window change "Url Behavior" from "Static" to "Dynamic". If the web
service client is a non-web application, this will automatically create a
file name app.config with the URL to the web service.

<appsettings><add key="myapplication.mywebservice.service1"
value="http://webservices.myCompany.com/myServices.asmx" </appsettings>

After you comiple your client app, the configuration file of it (such as
something.exe.config) will have the same content as the app.config. Now,
you can deploy the configuration along with the client executable. If you
ever need to change the web service location, you can open the
something.exe.config file in notepad and change the value attribute. If
the web service client is a web application such as asp.net web form,
changing "Url Behavior" from "Static" to "Dynamic" will automatically add
the same appsettings to web.config. Now, if you ever need to change the web
service location, you can open web.config file in notepad and change the
value attribute.

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
| From: ADingOD <(E-Mail Removed)>
| Subject: change Web References from web.config (or another solution?)
| Date: Fri, 15 Aug 2003 15:51:54 -0400
| Reply-To: http://www.velocityreviews.com/forums/(E-Mail Removed)
| Message-ID: <(E-Mail Removed)>
| X-Newsreader: Forte Agent 1.8/32.553
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
| NNTP-Posting-Host: 12.154.68.2
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservic es:18835
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
|
|
| Hi!
|
| It's any solution to change the Web References when the application is
| "moved" from "test" to "production" without a new compilation?
|
| I mean to use one "set" of webservices when is running on "test" and
| another "set" when is running on "production" without a recompilation.
|
| Any manual edit of web.config, registry... is permited.
|
| Thanks,
| Alexandru
|

 
Reply With Quote
 
 
 
 
Lewis Wang [MSFT]
Guest
Posts: n/a
 
      08-21-2003
Hi Dominique,

I think this problem can be better answered in microsoft.public.infopath,
thanks.

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "DDE" <(E-Mail Removed)>
| References: <(E-Mail Removed)>
<s0CH#(E-Mail Removed)>
| Subject: Re: change Web References from web.config (or another solution?)
| Date: Tue, 19 Aug 2003 09:03:15 +0400
| Lines: 78
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <(E-Mail Removed)>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
| NNTP-Posting-Host: p11-37.intnet.mu 202.123.11.37
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservic es:18871
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
|
| Would this also work if the client is Infopath ???
|
| Thanks
|
| Dominique
|
| "Lewis Wang [MSFT]" <(E-Mail Removed)> wrote in message
| news:s0CH#(E-Mail Removed)...
| > Hi Alexandru,
| >
| > You can configure the web service to pull the URL based on a setting in
a
| > configuration file, rather than a hardcoded value. To change the
location,
| > simply change the config file with no recompile. Here is how to do it:
| Add
| > your web reference. Go to "Solution Explorer", right click on the web
| > reference name (eg. "localhost") and choose properties. In the property
| > window change "Url Behavior" from "Static" to "Dynamic". If the web
| > service client is a non-web application, this will automatically create
a
| > file name app.config with the URL to the web service.
| >
| > <appsettings><add key="myapplication.mywebservice.service1"
| > value="http://webservices.myCompany.com/myServices.asmx" </appsettings>
| >
| > After you comiple your client app, the configuration file of it (such as
| > something.exe.config) will have the same content as the app.config. Now,
| > you can deploy the configuration along with the client executable. If
you
| > ever need to change the web service location, you can open the
| > something.exe.config file in notepad and change the value attribute. If
| > the web service client is a web application such as asp.net web form,
| > changing "Url Behavior" from "Static" to "Dynamic" will automatically
add
| > the same appsettings to web.config. Now, if you ever need to change the
| web
| > service location, you can open web.config file in notepad and change the
| > value attribute.
| >
| > Best regards,
| > Lewis
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| >
| >
| >
| > --------------------
| > | From: ADingOD <(E-Mail Removed)>
| > | Subject: change Web References from web.config (or another solution?)
| > | Date: Fri, 15 Aug 2003 15:51:54 -0400
| > | Reply-To: (E-Mail Removed)
| > | Message-ID: <(E-Mail Removed)>
| > | X-Newsreader: Forte Agent 1.8/32.553
| > | MIME-Version: 1.0
| > | Content-Type: text/plain; charset=us-ascii
| > | Content-Transfer-Encoding: 7bit
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
| > | NNTP-Posting-Host: 12.154.68.2
| > | Lines: 1
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webservic es:18835
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
| > |
| > |
| > | Hi!
| > |
| > | It's any solution to change the Web References when the application is
| > | "moved" from "test" to "production" without a new compilation?
| > |
| > | I mean to use one "set" of webservices when is running on "test" and
| > | another "set" when is running on "production" without a recompilation.
| > |
| > | Any manual edit of web.config, registry... is permited.
| > |
| > | Thanks,
| > | Alexandru
| > |
| >
|
|
|

 
Reply With Quote
 
DDE
Guest
Posts: n/a
 
      08-22-2003
Right, it is the thread I initiated in infopath newsgroup . looks like
there is no other solution in Infopath. Although I do not understand since I
suppose Infopath has been written with .NEDT Framework SDK.

Dominique


Thanks anyway.
"Lewis Wang [MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Dominique,
>
> This same question was brought up in the infopath newsgroup and was
> answered. You can view that question and link into the answer at this URL
> (please pardon the line breaks):
> http://www.google.com/groups?safe=images&ie=
> UTF-8&oe=UTF-8&as_umsgid=%3CO%247o2HuZDHA.
> (E-Mail Removed)%3E&lr=&hl=en
>
> Hope this helps.
>
> Best regards,
> Lewis
>
> This posting is provided "AS IS" with no warranties, and confers no

rights.
>
> --------------------
> | From: "DDE" <(E-Mail Removed)>
> | References: <(E-Mail Removed)>
> <s0CH#(E-Mail Removed)>
> <(E-Mail Removed)>
> <$(E-Mail Removed)>
> | Subject: Re: change Web References from web.config (or another

solution?)
> | Date: Thu, 21 Aug 2003 11:22:58 +0400
> | Lines: 19
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
> | Message-ID: <(E-Mail Removed)>
> | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
> | NNTP-Posting-Host: p0-180.intnet.mu 202.123.0.180
> | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
> | Xref: cpmsftngxa06.phx.gbl
> microsoft.public.dotnet.framework.aspnet.webservic es:18919
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
> |
> | I thought too ... but doesn't look like I can get an answer there.
> |
> | Dominique
> |
> |
> | "Lewis Wang [MSFT]" <(E-Mail Removed)> wrote in message
> | news:$(E-Mail Removed)...
> | > Hi Dominique,
> | >
> | > I think this problem can be better answered in
> microsoft.public.infopath,
> | > thanks.
> | >
> | > Best regards,
> | > Lewis
> | >
> | > This posting is provided "AS IS" with no warranties, and confers no
> | rights.
> |
> |
> |
>



 
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
Snake references just as ok as Monty Python jokes/references in python community? :) seberino@spawar.navy.mil Python 8 12-12-2006 11:21 PM
Typedef A references struct B which references struct A which... DanielEKFA C++ 8 05-16-2005 10:26 AM
Difference between bin and obj directories and difference between project references and dll references jakk ASP .Net 4 03-22-2005 09:23 PM
how to understand references to variables and references to constants are distinguished? baumann.Pan@gmail.com C++ 3 11-10-2004 04:16 AM
Pointers and References (and References to Pointers) Roger Leigh C++ 8 11-17-2003 10:14 AM



Advertisments