internal override IAsyncResult BeginRetrieve(TimeoutHelper timeoutHelper, AsyncCallback callback, object state) { AsyncMetadataLocationRetriever result; try { HttpWebRequest request; try { request = this.resolver.GetWebRequest(this.location, this.dialect, this.identifier); } #pragma warning suppress 56500 // covered by FxCOP catch (Exception e) { if (Fx.IsFatal(e)) throw; throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException( SR.GetString(SR.SFxMetadataExchangeClientCouldNotCreateWebRequest, this.location, this.dialect, this.identifier), e)); } TraceSendRequest(this.location); result = new AsyncMetadataLocationRetriever(request, this.resolver.MaxMessageSize, this.resolver.ReaderQuotas, timeoutHelper, callback, state); } #pragma warning suppress 56500 // covered by FxCOP catch (Exception e) { if (Fx.IsFatal(e)) throw; throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException( SR.GetString(SR.SFxBadMetadataReference, this.SourceUrl), e)); } return result; }
internal override IAsyncResult BeginRetrieve(TimeoutHelper timeoutHelper, AsyncCallback callback, object state) { AsyncMetadataLocationRetriever retriever; try { HttpWebRequest request; try { request = base.resolver.GetWebRequest(this.location, base.dialect, base.identifier); } catch (Exception exception) { if (Fx.IsFatal(exception)) { throw; } throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("SFxMetadataExchangeClientCouldNotCreateWebRequest", new object[] { this.location, base.dialect, base.identifier }), exception)); } MetadataExchangeClient.TraceSendRequest(this.location); retriever = new AsyncMetadataLocationRetriever(request, base.resolver.MaxMessageSize, base.resolver.ReaderQuotas, timeoutHelper, callback, state); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("SFxBadMetadataReference", new object[] { this.SourceUrl }), exception2)); } return retriever; }