Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / TransactionBridge / Microsoft / Transactions / Wsat / Messaging / RegistrationProxy.cs / 1 / RegistrationProxy.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- // Define the interfaces and infrastructure needed to send registration messages using System; using System.ServiceModel.Channels; using System.Diagnostics; using System.ServiceModel; namespace Microsoft.Transactions.Wsat.Messaging { class RegistrationProxy : RequestReplyProxy { public RegistrationProxy(CoordinationService coordination, EndpointAddress to) : base (coordination, to) {} protected override IChannelFactorySelectChannelFactory(out MessageVersion messageVersion) { messageVersion = this.coordinationService.InteropRegistrationBinding.MessageVersion; return this.coordinationService.InteropRegistrationChannelFactory; } RegisterMessage CreateRegisterMessage (ref Register register) { RegisterMessage message = new RegisterMessage(this.messageVersion, ref register); if (register.SupportingToken != null) { CoordinationServiceSecurity.AddSupportingToken(message, register.SupportingToken); } return message; } public RegisterResponse SendRegister (ref Register register) { if (DebugTrace.Verbose) { DebugTrace.Trace(TraceLevel.Verbose, "Sending Register to {0}", this.to.Uri); } Message message = CreateRegisterMessage(ref register); Message reply = SendRequest(message, this.coordinationStrings.RegisterResponseAction); using (reply) { if (DebugTrace.Verbose) { DebugTrace.Trace(TraceLevel.Verbose, "Dispatching RegisterResponse reply"); if (DebugTrace.Pii) DebugTrace.TracePii(TraceLevel.Verbose, "Sender is {0}", CoordinationServiceSecurity.GetSenderName(reply)); } return new RegisterResponse(reply, this.protocolVersion); } } public IAsyncResult BeginSendRegister (ref Register register, AsyncCallback callback, object state) { if (DebugTrace.Verbose) { DebugTrace.Trace(TraceLevel.Verbose, "Sending Register to {0}", this.to.Uri); } Message message = CreateRegisterMessage (ref register); return BeginSendRequest (message, callback, state); } public RegisterResponse EndSendRegister (IAsyncResult ar) { try { Message reply = EndSendRequest(ar, this.coordinationStrings.RegisterResponseAction); using (reply) { if (DebugTrace.Verbose) { DebugTrace.Trace(TraceLevel.Verbose, "Dispatching RegisterResponse reply"); if (DebugTrace.Pii) DebugTrace.TracePii(TraceLevel.Verbose, "Sender is {0}", CoordinationServiceSecurity.GetSenderName(reply)); } return new RegisterResponse(reply, this.protocolVersion); } } catch (CommunicationException e) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WsatReceiveFailureException(e)); } } public static void SendRegisterResponse (RequestAsyncResult result, ref RegisterResponse response) { Message message = new RegisterResponseMessage (result.MessageVersion, ref response); result.Finished (message); } public static void SendFaultResponse (RequestAsyncResult result, Fault fault) { Library.SendFaultResponse (result, fault); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FileSecurity.cs
- ListDataHelper.cs
- Debug.cs
- ContractBase.cs
- WebScriptEndpointElement.cs
- ExpressionDumper.cs
- InvalidAsynchronousStateException.cs
- SQLStringStorage.cs
- LogManagementAsyncResult.cs
- ClientViaElement.cs
- SoapSchemaMember.cs
- XmlCompatibilityReader.cs
- FlowDocument.cs
- SmiSettersStream.cs
- ParamArrayAttribute.cs
- RegexCode.cs
- SqlInfoMessageEvent.cs
- Quad.cs
- VariableModifiersHelper.cs
- FontTypeConverter.cs
- PrefixQName.cs
- JournalNavigationScope.cs
- HttpPostProtocolReflector.cs
- VectorConverter.cs
- SynchronizedMessageSource.cs
- DotExpr.cs
- RadioButtonFlatAdapter.cs
- XmlReflectionImporter.cs
- SafeSystemMetrics.cs
- DifferencingCollection.cs
- StrokeNodeEnumerator.cs
- Point4DConverter.cs
- AuthenticationServiceManager.cs
- PartialCachingAttribute.cs
- DeclaredTypeValidatorAttribute.cs
- SizeAnimation.cs
- Base64Encoding.cs
- DataViewManagerListItemTypeDescriptor.cs
- FatalException.cs
- TargetControlTypeCache.cs
- StructuralType.cs
- UserPersonalizationStateInfo.cs
- Image.cs
- PerfCounters.cs
- BStrWrapper.cs
- IIS7WorkerRequest.cs
- WindowsSecurityTokenAuthenticator.cs
- ApplicationSecurityInfo.cs
- FrameworkTextComposition.cs
- ConsoleCancelEventArgs.cs
- Cell.cs
- Function.cs
- Metafile.cs
- DetailsViewPageEventArgs.cs
- ReferenceEqualityComparer.cs
- WorkflowServiceBehavior.cs
- BrowserCapabilitiesCompiler.cs
- RegexCaptureCollection.cs
- ExtractCollection.cs
- Size.cs
- BulletChrome.cs
- MergeEnumerator.cs
- AssemblyName.cs
- AccessViolationException.cs
- DeflateStream.cs
- RoutedEventValueSerializer.cs
- PreviewPrintController.cs
- EventListener.cs
- SecurityKeyIdentifier.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- SqlLiftIndependentRowExpressions.cs
- MetadataArtifactLoaderCompositeFile.cs
- HttpRuntimeSection.cs
- Marshal.cs
- AuthorizationContext.cs
- CapabilitiesUse.cs
- TaiwanCalendar.cs
- AlphaSortedEnumConverter.cs
- ListenerElementsCollection.cs
- TokenBasedSet.cs
- EntityContainerEmitter.cs
- RecordConverter.cs
- ThreadInterruptedException.cs
- ToolTipAutomationPeer.cs
- XmlSchemaAnyAttribute.cs
- ButtonAutomationPeer.cs
- PathFigure.cs
- TransactionalPackage.cs
- BamlStream.cs
- HttpProfileGroupBase.cs
- InteropBitmapSource.cs
- ContentPropertyAttribute.cs
- DataGridViewTopLeftHeaderCell.cs
- PersonalizationProviderHelper.cs
- XslAst.cs
- SafeNativeMethods.cs
- ParsedAttributeCollection.cs
- ProcessHostMapPath.cs
- WorkflowFormatterBehavior.cs
- WeakReferenceEnumerator.cs