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
- UnicodeEncoding.cs
- XpsViewerException.cs
- SecurityAttributeGenerationHelper.cs
- BrowserCapabilitiesCodeGenerator.cs
- ProcessingInstructionAction.cs
- DataGridViewCellStyle.cs
- IOThreadTimer.cs
- ProfessionalColorTable.cs
- QueryReaderSettings.cs
- ActivityTypeResolver.xaml.cs
- DataService.cs
- ExpressionBuilderCollection.cs
- WebPartMinimizeVerb.cs
- DbDataRecord.cs
- CodeValidator.cs
- ListViewItem.cs
- MessageVersion.cs
- SvcMapFile.cs
- CallbackWrapper.cs
- WebPartVerbsEventArgs.cs
- FailedToStartupUIException.cs
- Models.cs
- CurrentChangedEventManager.cs
- FileDialogPermission.cs
- SqlClientFactory.cs
- ObjectCacheSettings.cs
- OdbcCommandBuilder.cs
- KeyedCollection.cs
- PathFigure.cs
- KoreanLunisolarCalendar.cs
- SQLBytesStorage.cs
- AssemblySettingAttributes.cs
- DataControlFieldCollection.cs
- AppearanceEditorPart.cs
- ReadOnlyMetadataCollection.cs
- MemoryFailPoint.cs
- GlobalizationSection.cs
- LinkArea.cs
- SqlVisitor.cs
- CryptoHelper.cs
- GacUtil.cs
- RequestSecurityTokenForRemoteTokenFactory.cs
- ChildrenQuery.cs
- ExpressionEditorSheet.cs
- GroupBox.cs
- HttpApplication.cs
- ExpressionBinding.cs
- ListViewItem.cs
- Operators.cs
- sqlcontext.cs
- TextViewBase.cs
- FontStyle.cs
- TableLayoutSettingsTypeConverter.cs
- IndentTextWriter.cs
- XPathBinder.cs
- ExecutionScope.cs
- WebPartCatalogCloseVerb.cs
- ComponentSerializationService.cs
- ForeignConstraint.cs
- EntityDescriptor.cs
- RequestUriProcessor.cs
- CacheMemory.cs
- StringStorage.cs
- Base64Stream.cs
- TimeStampChecker.cs
- XappLauncher.cs
- PropertyConverter.cs
- SyndicationItem.cs
- LinkClickEvent.cs
- WindowsListViewItem.cs
- ChtmlCalendarAdapter.cs
- RSAProtectedConfigurationProvider.cs
- Ref.cs
- ActivityFunc.cs
- XmlArrayAttribute.cs
- WebPartDescriptionCollection.cs
- ViewStateException.cs
- Token.cs
- InheritanceContextHelper.cs
- DataGridViewCellLinkedList.cs
- ReceiveActivity.cs
- SqlDependency.cs
- SQLMembershipProvider.cs
- loginstatus.cs
- EnlistmentTraceIdentifier.cs
- Object.cs
- TaskResultSetter.cs
- ExtensionDataReader.cs
- SqlEnums.cs
- TextTreeInsertElementUndoUnit.cs
- CngAlgorithm.cs
- SafeNativeMethodsCLR.cs
- WasHttpHandlersInstallComponent.cs
- RTTrackingProfile.cs
- AnnotationHighlightLayer.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- HttpInputStream.cs
- ThaiBuddhistCalendar.cs
- Form.cs
- OleAutBinder.cs