Browse Source

SD2-710 - Unable to add a web reference by browsing to a wsdl file when entering a file path (e.g. 'file:///C:/Projects/MyService.wsdl'). The web service discovery code no longer assumes the received response is a HttpWebResponse object.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1191 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 20 years ago
parent
commit
3ae2408380
  1. 7
      src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AddWebReferenceDialog.cs
  2. 6
      src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/WebServiceDiscoveryClientProtocol.cs

7
src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AddWebReferenceDialog.cs

@ -589,7 +589,12 @@ namespace ICSharpCode.SharpDevelop.Gui
if (discoveryClientProtocol != null) { if (discoveryClientProtocol != null) {
try { try {
discoveryClientProtocol.Abort(); discoveryClientProtocol.Abort();
} catch (NotImplementedException) {}; } catch (NotImplementedException) {
} catch (ObjectDisposedException) {
// Receive this error if the url pointed to a file.
// The discovery client will already have closed the file
// so the abort fails.
}
discoveryClientProtocol.Dispose(); discoveryClientProtocol.Dispose();
} }
discoveryClientProtocol = new WebServiceDiscoveryClientProtocol(); discoveryClientProtocol = new WebServiceDiscoveryClientProtocol();

6
src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/WebServiceDiscoveryClientProtocol.cs

@ -42,9 +42,9 @@ namespace ICSharpCode.SharpDevelop.Gui
protected override WebResponse GetWebResponse(WebRequest request) protected override WebResponse GetWebResponse(WebRequest request)
{ {
lastResponseReceived = null; WebResponse response = base.GetWebResponse(request);
lastResponseReceived = base.GetWebResponse(request) as HttpWebResponse; lastResponseReceived = response as HttpWebResponse;
return lastResponseReceived; return response;
} }
} }
} }

Loading…
Cancel
Save