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
- InheritablePropertyChangeInfo.cs
- SynchronizingStream.cs
- ClientFormsIdentity.cs
- MaskedTextBox.cs
- AttributeSetAction.cs
- ExpressionBindingCollection.cs
- UITypeEditor.cs
- TextChange.cs
- SecurityPermission.cs
- XmlComment.cs
- _Semaphore.cs
- DataErrorValidationRule.cs
- HtmlAnchor.cs
- DesignerAttribute.cs
- PolyQuadraticBezierSegment.cs
- GridViewDeleteEventArgs.cs
- LinqDataSourceInsertEventArgs.cs
- QueryOutputWriter.cs
- HtmlHistory.cs
- Vector3DCollection.cs
- ResetableIterator.cs
- CodePageUtils.cs
- xml.cs
- EntityDataSourceWizardForm.cs
- WindowInteractionStateTracker.cs
- DES.cs
- BridgeDataReader.cs
- UnsafeNativeMethods.cs
- ToolStripSeparator.cs
- EUCJPEncoding.cs
- TimeSpanValidator.cs
- ConnectionPoint.cs
- Codec.cs
- SubtreeProcessor.cs
- CompoundFileStorageReference.cs
- TreeViewAutomationPeer.cs
- SortDescriptionCollection.cs
- CustomBindingElementCollection.cs
- SrgsDocumentParser.cs
- EntityCodeGenerator.cs
- MULTI_QI.cs
- ContentPresenter.cs
- TypeDescriptor.cs
- DbConnectionStringBuilder.cs
- GPPOINT.cs
- indexingfiltermarshaler.cs
- DBCSCodePageEncoding.cs
- CustomAttribute.cs
- DesignTimeParseData.cs
- CellParagraph.cs
- Matrix3DConverter.cs
- DataSourceControlBuilder.cs
- MetadataUtilsSmi.cs
- SupportsEventValidationAttribute.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- AnonymousIdentificationSection.cs
- TemplatedWizardStep.cs
- Helpers.cs
- PhoneCallDesigner.cs
- XmlAttributeOverrides.cs
- XmlnsDefinitionAttribute.cs
- SimplePropertyEntry.cs
- ReadOnlyMetadataCollection.cs
- compensatingcollection.cs
- WebConfigurationManager.cs
- ConfigurationSectionCollection.cs
- DateTimeConverter2.cs
- ProgressBarHighlightConverter.cs
- COM2IDispatchConverter.cs
- HttpCachePolicy.cs
- KnownBoxes.cs
- ListBoxItemAutomationPeer.cs
- WebReferencesBuildProvider.cs
- EncryptedType.cs
- Rotation3DAnimationUsingKeyFrames.cs
- SearchForVirtualItemEventArgs.cs
- StorageEndPropertyMapping.cs
- ApplicationGesture.cs
- DefaultSettingsSection.cs
- PointConverter.cs
- Int32CollectionConverter.cs
- _SslState.cs
- TableItemPattern.cs
- SoapParser.cs
- AssociatedControlConverter.cs
- NetworkInterface.cs
- XPathAxisIterator.cs
- GACMembershipCondition.cs
- CustomAttributeFormatException.cs
- DesignerRegion.cs
- ResourcesBuildProvider.cs
- ListViewInsertEventArgs.cs
- Bits.cs
- UIElementParagraph.cs
- AuthStoreRoleProvider.cs
- PropertyGridEditorPart.cs
- MailAddressCollection.cs
- MemberDescriptor.cs
- NumericUpDownAccelerationCollection.cs
- ComponentResourceKey.cs