Share via


How to: Update Web Service Client URIs in Configuration Files

When you prepare to deploy Web service consumer applications, you need to update their configuration files with the locations of the Web services in the deployment environment. For more information, see Application Information in Deployment Reports.

However, before you perform this task, you first need to retrieve the absolute URIs of the Web service provider endpoints from the XML version of the deployment report. For more information, see How to: Find Web Service and Web Content Absolute URIs in Deployment Reports.

To update the Web service client URI for an ASP.NET application

  1. Open the Web.config file for the ASP.NET application connected to the Web service provider endpoint.

  2. In the Web.config file, locate the <appSettings> element.

  3. Under the <appSettings> element, locate the <add> element whose "Value" attribute matches the value of the Target Location property of the Web service consumer endpoint.

    Tip

    You can find the Target Location property by selecting the Web service consumer endpoint on the application diagram and pressing F4 to open the Properties window.

  4. From the <add> element, copy the value of the "Key" attribute to the Config File Entry setting on the Web service consumer endpoint.

    Tip

    To locate the Config File Entry setting, right-click the Web service consumer endpoint on the application diagram and choose Settings and Constraints. In the Settings and Constraints Editor, select the Application Endpoint Settings node. The Config File Entry setting is located in the right pane of the Settings and Constraints Editor. For more information, see Settings and Constraints Editor.

  5. If you have not already retrieved the absolute URI for the connected Web service provider endpoint, retrieve that absolute URI.

  6. In the <add> element, replace the value in the "Value" attribute with the Web service provider endpoint's absolute URI.

    Tip

    If needed, use the value that you copied to the Config File Entry setting to locate the <add> element with a matching "Key" attribute value in the Web.config file.

Copying the "Key" attribute value to the Config File Entry setting specifies the configuration file entry that maps to the consumer endpoint. At deployment, this setting determines which configuration file entry to set once deployment parameters are resolved. You can also use this setting to locate that value in the Web.config file when you update it with the absolute URI.

To update the Web service client URI for a Windows or Office application

  1. Open the App.config file for the Windows or Office application connected to the Web service provider endpoint.

  2. In the App.config file, locate the <applicationSettings> element.

  3. Under the <applicationSettings> element, locate the following element where ApplicationName is the corresponding application name:

    • <ApplicationName.Properties.Settings> element (Visual C# and Visual J# Windows and Office applications)

    • <ApplicationName.My.MySettings> element (Visual Basic Windows applications)

    • <ApplicationName.Settings> element (Visual Basic Office applications)

  4. Within this element, locate the <Setting> element whose "Value" attribute matches the value of the Target Location property of the Web service consumer endpoint.

    Tip

    You can find the Target Location property by selecting the Web service consumer endpoint on the application diagram and pressing F4 to open the Properties window.

  5. From the <Setting> element, copy the value of the "Name" attribute to the Config File Entry setting on the Web service consumer endpoint.

    Tip

    To locate the Config File Entry setting, right-click the Web service consumer endpoint on the application diagram and choose Settings and Constraints. In the Settings and Constraints Editor, select the Application Endpoint Settings node. The Config File Entry setting is located in the right pane of the Settings and Constraints Editor. For more information, see Settings and Constraints Editor.

  6. If you have not already retrieved the absolute URI for the connected Web service provider endpoint, retrieve that absolute URI.

  7. Under the matching <Setting> element, replace the value in the "Value" attribute with the Web service provider endpoint's absolute URI.

    Tip

    If needed, use the value that you copied to the Config File Entry setting to locate the <Setting> element with a matching "Name" attribute value in the App.config file.

Copying the "Name" attribute value to the Config File Entry setting specifies the configuration file entry that maps to the consumer endpoint. At deployment, this setting determines which configuration file entry to set once deployment parameters are resolved. You can also use this setting to locate that value in the App.config file when you update it with the absolute URI.

See Also

Concepts

Overview of Deployment Using Deployment Reports