Ejemplo n.º 1
0
        /// <summary>
        /// Adds log subscription
        /// </summary>
        /// <param name="uri">Receiver address</param>
        /// <param name="messageType">Message types of interest</param>
        /// <returns>Subscription ID for firther operations</returns>
        public Guid Subscribe(string uri, MessageType messageType)
        {
            CustomBinding custombindingSoap12 = new CustomBinding();

            custombindingSoap12.Elements.Add(new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, Encoding.UTF8));
            custombindingSoap12.Elements.Add(new HttpTransportBindingElement());

            EndpointAddress address = new EndpointAddress(uri);

            LogReceiverSoapClient client = new LogReceiverSoapClient(custombindingSoap12, address);

            LogSubscriptionHolder holder = new LogSubscriptionHolder();

            holder.Client      = client;
            holder.MessageType = messageType;

            Guid guid = Subscribe(holder);

            return(guid);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Sends welcome message to new client
 /// </summary>
 /// <param name="client"></param>
 void SendWelcomeMessage(LogReceiverSoapClient client)
 {
     client.LogMessage("Your subscription (to logging) has been created successfully", MessageType.Message);
 }