
Configuration File Entries for Custom Web Service Proxy Client Classes Used with Windows and Office Applications
For custom proxy classes used with Windows and Office applications, Web service URL settings must appear in an applicationSettings entry in the App.config configuration file of the consumer application. You cannot view or edit these settings using the Settings and Constraints Editor, so you must create or edit these settings using the Settings pane accessed by right-clicking the Windows or Office application project and viewing the project's properties. You must also designate these settings as WebServiceURL or String type. For more information, see Managing Application Settings.
Note: |
|---|
The
WebServiceURL type designation does not appear in the App.config configuration file; however, it is stored in an associated settings file that is normally hidden. If you manually add the setting to the App.config configuration file, you must add the WebServiceURL or String type designation as a setting in the Settings pane.
|
In the Settings pane, you can choose Application or User scope for the setting if you designate it as WebServiceURL type. Changing the scope moves the entry to the applicationSettings or userSettings section in the configuration file. However, if you choose to designate the setting as a String type, you must choose Application for the scope.
Tip: |
|---|
When specifying a Web service URL setting in the App.config file, specify the location of the Web service, not the location of the Web service description or WSDL file. For .asmx file-based Web services, the Web service description is often at the same location as the WSDL location. Therefore, for .asmx file-based Web services, Application Designer will assume that the Web service location is the same as the WSDL file location. If a WSDL file is found at that location, an external Web service is reverse-engineered onto the application diagram and connected to a reverse-engineered Web service consumer endpoint. If a valid WSDL file is not found at that location, only the Web service consumer endpoint is reverse-engineered.
|
The following example shows how an applicationSettings entry might appear in an App.config configuration file of a Windows project when the setting is designated as String type:
<applicationSettings>
<WindowsApplicationName.MySettings>
<setting name="WindowsApplicationName_Namespace_WebServiceProxyClassName" serializeAs="String">
<value>http://WebServiceURL.asmx</value>
</setting>
</WindowsApplicationName.MySettings>
</applicationSettings>
For entries with WebServiceURL type, the name of the setting does not need to be the proxy class name. A configuration file entry that is defined in this way and is designated with the WebServiceURL or String type in the Settings pane is all that is required to create a Web service consumer endpoint on a Windows or Office application, even if no custom proxy class is associated with the entry. Deleting such an endpoint deletes the entry but does not delete the associated custom proxy class.