[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

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

ADingOD

8/15/2003 7:52:00 PM


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
3 Answers

v-lwang

8/18/2003 4:00:00 AM

0

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.... </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 <adimitriev@travtech.com>
| Subject: change Web References from web.config (or another solution?)
| Date: Fri, 15 Aug 2003 15:51:54 -0400
| Reply-To: adimitriev@travtech.com
| Message-ID: <p6eqjvg3u7vj98doo5m0secj071v2ukk81@4ax.com>
| 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.webservices
| NNTP-Posting-Host: 12.154.68.2
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:18835
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
|
| 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
|

v-lwang

8/21/2003 4:01:00 AM

0

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" <dde@iaireinfo.com>
| References: <p6eqjvg3u7vj98doo5m0secj071v2ukk81@4ax.com>
<s0CH#0TZDHA.1468@cpmsftngxa06.phx.gbl>
| 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: <eHWM18gZDHA.736@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| NNTP-Posting-Host: p11-37.intnet.mu 202.123.11.37
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:18871
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| Would this also work if the client is Infopath ???
|
| Thanks
|
| Dominique
|
| "Lewis Wang [MSFT]" <v-lwang@online.microsoft.com> wrote in message
| news:s0CH#0TZDHA.1468@cpmsftngxa06.phx.gbl...
| > 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.... </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 <adimitriev@travtech.com>
| > | Subject: change Web References from web.config (or another solution?)
| > | Date: Fri, 15 Aug 2003 15:51:54 -0400
| > | Reply-To: adimitriev@travtech.com
| > | Message-ID: <p6eqjvg3u7vj98doo5m0secj071v2ukk81@4ax.com>
| > | 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.webservices
| > | NNTP-Posting-Host: 12.154.68.2
| > | Lines: 1
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webservices:18835
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
| > |
| > |
| > | 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
| > |
| >
|
|
|

DDE

8/22/2003 6:08:00 AM

0

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]" <v-lwang@online.microsoft.com> wrote in message
news:flbmovEaDHA.716@cpmsftngxa06.phx.gbl...
> 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=imag...
> UTF-8&oe=UTF-8&as_umsgid=%3CO%247o2HuZDHA.
> 2932@tk2msftngp13.phx.gbl%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" <dde@iaireinfo.com>
> | References: <p6eqjvg3u7vj98doo5m0secj071v2ukk81@4ax.com>
> <s0CH#0TZDHA.1468@cpmsftngxa06.phx.gbl>
> <eHWM18gZDHA.736@TK2MSFTNGP09.phx.gbl>
> <$B3zUj5ZDHA.916@cpmsftngxa06.phx.gbl>
> | 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: <OjHpOU7ZDHA.2592@TK2MSFTNGP09.phx.gbl>
> | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
> | NNTP-Posting-Host: p0-180.intnet.mu 202.123.0.180
> | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
> | Xref: cpmsftngxa06.phx.gbl
> microsoft.public.dotnet.framework.aspnet.webservices:18919
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
> |
> | I thought too ... but doesn't look like I can get an answer there.
> |
> | Dominique
> |
> |
> | "Lewis Wang [MSFT]" <v-lwang@online.microsoft.com> wrote in message
> | news:$B3zUj5ZDHA.916@cpmsftngxa06.phx.gbl...
> | > 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.
> |
> |
> |
>