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
- XamlWriter.cs
- SignerInfo.cs
- HttpModuleAction.cs
- AllowedAudienceUriElementCollection.cs
- ProviderBase.cs
- ModifyActivitiesPropertyDescriptor.cs
- BindUriHelper.cs
- MessageAction.cs
- StylusButton.cs
- XPathNodeHelper.cs
- ObjectListCommand.cs
- RecognizerStateChangedEventArgs.cs
- BitmapEffect.cs
- AutoGeneratedFieldProperties.cs
- ColumnResult.cs
- NonValidatingSecurityTokenAuthenticator.cs
- StandardCommands.cs
- ActiveXContainer.cs
- SqlLiftIndependentRowExpressions.cs
- GPRECTF.cs
- ToolBarPanel.cs
- FutureFactory.cs
- FaultDescription.cs
- KeyTimeConverter.cs
- UpdateExpressionVisitor.cs
- LinkButton.cs
- ByteStream.cs
- HttpCapabilitiesEvaluator.cs
- MainMenu.cs
- InheritanceUI.cs
- ReferentialConstraintRoleElement.cs
- SoapMessage.cs
- PeerApplicationLaunchInfo.cs
- TableAdapterManagerGenerator.cs
- NotCondition.cs
- SqlMethodAttribute.cs
- MasterPageBuildProvider.cs
- XmlBufferReader.cs
- TreeNodeStyleCollection.cs
- SystemBrushes.cs
- SharedPersonalizationStateInfo.cs
- WebPartCollection.cs
- Win32.cs
- PersonalizationStateQuery.cs
- SessionIDManager.cs
- WorkflowServiceHost.cs
- ClockController.cs
- RootProfilePropertySettingsCollection.cs
- HostingEnvironmentException.cs
- ReadOnlyActivityGlyph.cs
- CalendarSelectionChangedEventArgs.cs
- odbcmetadatacolumnnames.cs
- ExpressionNode.cs
- KeyboardDevice.cs
- FillBehavior.cs
- XmlDocument.cs
- RtfFormatStack.cs
- InputBinder.cs
- DataPagerField.cs
- ToolStripActionList.cs
- XPathSelfQuery.cs
- X509WindowsSecurityToken.cs
- ArrangedElement.cs
- ProxySimple.cs
- PersonalizablePropertyEntry.cs
- xmlglyphRunInfo.cs
- AuthorizationRule.cs
- EncoderReplacementFallback.cs
- XmlReader.cs
- TemplateField.cs
- SqlNotificationEventArgs.cs
- PathFigureCollection.cs
- SqlCacheDependency.cs
- ModelToObjectValueConverter.cs
- CodeTypeReferenceSerializer.cs
- ResXResourceSet.cs
- GridViewRowPresenter.cs
- GenericEnumerator.cs
- ValueChangedEventManager.cs
- PerformanceCounterCategory.cs
- MbpInfo.cs
- ArrayList.cs
- DecimalStorage.cs
- configsystem.cs
- DictionaryMarkupSerializer.cs
- followingquery.cs
- ValidateNames.cs
- serverconfig.cs
- ColumnMapProcessor.cs
- PaperSource.cs
- DisableDpiAwarenessAttribute.cs
- PriorityItem.cs
- PersonalizationStateQuery.cs
- StateBag.cs
- MachinePropertyVariants.cs
- ContractReference.cs
- DynamicValidatorEventArgs.cs
- PermissionSetEnumerator.cs
- SortExpressionBuilder.cs
- PipelineModuleStepContainer.cs