private NetMessagingTransportBindingElement(NetMessagingTransportBindingElement other) : base(other) { this.prefetchCount = other.prefetchCount; this.SessionIdleTimeout = other.SessionIdleTimeout; this.transportSettings = (NetMessagingTransportSettings)other.transportSettings.Clone(); this.receiveContextSettings = other.receiveContextSettings; }
internal static bool TryCreate(BindingElementCollection elements, out NetMessagingBinding binding) { bool flag; binding = null; if (elements.Count > 2) { return(false); } BinaryMessageEncodingBindingElement binaryMessageEncodingBindingElement = null; NetMessagingTransportBindingElement netMessagingTransportBindingElement = null; using (IEnumerator <BindingElement> enumerator = elements.GetEnumerator()) { while (enumerator.MoveNext()) { BindingElement current = enumerator.Current; if (current is TransportBindingElement) { netMessagingTransportBindingElement = current as NetMessagingTransportBindingElement; } else if (!(current is BinaryMessageEncodingBindingElement)) { flag = false; return(flag); } else { binaryMessageEncodingBindingElement = current as BinaryMessageEncodingBindingElement; } } if (netMessagingTransportBindingElement == null) { return(false); } if (binaryMessageEncodingBindingElement == null) { return(false); } NetMessagingBinding netMessagingBinding = new NetMessagingBinding(); netMessagingBinding.InitializeFrom(binaryMessageEncodingBindingElement, netMessagingTransportBindingElement); if (!netMessagingBinding.IsBindingElementsMatch(binaryMessageEncodingBindingElement, netMessagingTransportBindingElement)) { return(false); } binding = netMessagingBinding; return(true); } return(flag); }
void System.ServiceModel.Description.IWsdlExportExtension.ExportEndpoint(WsdlExporter exporter, WsdlEndpointConversionContext context) { MessageEncodingBindingElement messageEncodingBindingElement = context.Endpoint.Binding.CreateBindingElements().Find <MessageEncodingBindingElement>(); if (messageEncodingBindingElement == null) { messageEncodingBindingElement = Microsoft.ServiceBus.Messaging.Channels.TransportDefaults.CreateDefaultEncoder(); } SoapBinding soapBinding = NetMessagingTransportBindingElement.GetSoapBinding(context, exporter); if (soapBinding != null) { soapBinding.Transport = "http://sample.schemas.microsoft.com/policy/netMessaging"; } if (context.WsdlPort != null) { WSAddressingHelper.AddAddressToWsdlPort(context.WsdlPort, context.Endpoint.Address, messageEncodingBindingElement.MessageVersion.Addressing); } }
private static bool IsTransportMatch(BindingElement a, BindingElement b) { if (b == null) { return(false); } NetMessagingTransportBindingElement netMessagingTransportBindingElement = a as NetMessagingTransportBindingElement; NetMessagingTransportBindingElement netMessagingTransportBindingElement1 = b as NetMessagingTransportBindingElement; if (netMessagingTransportBindingElement1 == null) { return(false); } if (netMessagingTransportBindingElement.MaxBufferPoolSize != netMessagingTransportBindingElement1.MaxBufferPoolSize) { return(false); } if (netMessagingTransportBindingElement.MaxReceivedMessageSize != netMessagingTransportBindingElement1.MaxReceivedMessageSize) { return(false); } return(true); }
public NetMessagingBinding() { this.encoder = Microsoft.ServiceBus.Messaging.Channels.TransportDefaults.CreateDefaultEncoder(); this.transport = new NetMessagingTransportBindingElement(); }
private bool IsBindingElementsMatch(BinaryMessageEncodingBindingElement binaryEncoding, NetMessagingTransportBindingElement netMessagingTransport) { if (!NetMessagingBinding.IsTransportMatch(this.transport, netMessagingTransport)) { return(false); } if (!NetMessagingBinding.IsEncodingMatch(this.encoder, binaryEncoding)) { return(false); } return(true); }
private void InitializeFrom(BinaryMessageEncodingBindingElement binaryEncoding, NetMessagingTransportBindingElement netMessagingTransport) { this.transport.MaxBufferPoolSize = netMessagingTransport.MaxBufferPoolSize; this.transport.MaxReceivedMessageSize = netMessagingTransport.MaxReceivedMessageSize; binaryEncoding.ReaderQuotas.CopyTo(this.encoder.ReaderQuotas); }