I'm currently working on a piece of software designed in WPF that connects to a set of WebServices. The WebServices are defined in the app.config:endpoint of my application:
<endpoint address="http://localhost:52870/WebServices/Service.svc"
behaviorConfiguration="VanguardWebServiceBehavior" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IService" contract="WebServices.IService"
name="WSHttpBinding_IService">
and in the ApplicationSettings:
<applicationSettings>
<MyApp.Properties.Settings>
<setting name="PrimaryRS" serializeAs="String">
<value>http://localhost:50563/</value>
</setting>
<setting name="PrimaryWS" serializeAs="String">
<value>http://localhost:52870/WebServices/Service.svc</value>
</setting>
<setting name="SecondaryWS" serializeAs="String">
<value>http://localhost:52870/WebServices/Service.svc</value>
</setting>
</MyApp.Properties.Settings>
</applicationSettings>
This works fine, so long as the WebServices are accessible, however when the WebServices are not accessible the application crashes. I am wondering if there is anyway to catch the Exceptions that are thrown when the WebServices are not accessible, and simply open the application in some sort of Disconnected state, such that nothing is editable.
Thanks in advance,
Patrick