RE: Dynamic Web Service URL Reference
- From: wawang@xxxxxxxxxxxxxxxxxxxx (Walter Wang [MSFT])
- Date: Fri, 16 Feb 2007 02:18:07 GMT
{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fswiss\fprq2\fcharset0 Verdana;}}
\viewkind4\uc1\pard\lang2052\f0\fs20 Hi David,
\par
\par In .NET 2.0, the webservice URL is still stored in your configuration file (web.config or app.config). If you open the generated "Reference.cs", you will see code like following:
\par
\par public Service() \{
\par this.Url = global::ConsoleApplication1.Properties.Settings.Default.ConsoleApplication1_localhost_Service;
\par
\par
\par It's now using a strong typed Setting named "ConsoleApplication1_localhost_service" which can be modified using the Setting Designer in Visual Studio 2005:
\par
\par http://msdn2.microsoft.com/en-us/library/aa730869(vs.80).aspx
\par
\par If you open the App.config, you will see:
\par
\par <configSections>
\par <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
\par <section name="ConsoleApplication1.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
\par </sectionGroup>
\par </configSections>
\par <applicationSettings>
\par <ConsoleApplication1.Properties.Settings>
\par <setting name="ConsoleApplication1_localhost_Service" serializeAs="String">
\par <value>http://localhost:4799/WebService1/Service.asmx</value>
\par </setting>
\par </ConsoleApplication1.Properties.Settings>
\par </applicationSettings>
\par
\par
\par This is called Application Settings:
\par
\par http://msdn2.microsoft.com/en-us/library/a65txexh(VS.80).aspx
\par
\par To modify this config using Msbuild, please refer to following article:
\par
\par http://geekswithblogs.net/paulwhitblog/archive/2006/04/11/74844.aspx
\par
\par It has some msbuild task to let you easily update the config file when building the project.
\par
\par Hope this helps.
\par
\par
\par Sincerely,
\par Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
\par Microsoft Online Community Support
\par
\par ==================================================
\par Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notifications. If you are using Outlook Express, please make sure you clear the check box "Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
\par
\par Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx.
\par ==================================================
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par }
- Prev by Date: RE: Need help with 'Microsoft.Web.Services3.SoapContext' error
- Next by Date: SAML STS WSE 3.0 Problems replacing the SAML Authority Certificate
- Previous by thread: RE: Need help with 'Microsoft.Web.Services3.SoapContext' error
- Next by thread: RE: Dynamic Web Service URL Reference
- Index(es):
Relevant Pages
|