Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wcf receiver client #874

Merged
merged 29 commits into from
Aug 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
373af94
interface changes
304NotModified Jul 19, 2015
01e14ba
renamed interface and classes to twoway... and oneway... fix facade
304NotModified Jul 19, 2015
fcca6c6
extracted and implemented base class
304NotModified Jul 20, 2015
6cdeb4e
Merge remote-tracking branch 'upstream/master' into WCF-backwardscomp
304NotModified Jul 20, 2015
0f54a41
added methods otherwise async error
304NotModified Jul 20, 2015
c3f080f
Revert "extracted and implemented base class"
304NotModified Jul 20, 2015
bbf4e9f
revert configname
304NotModified Jul 20, 2015
c9e137b
base interface to markerinterface
304NotModified Jul 20, 2015
6e781c1
removed double
304NotModified Jul 20, 2015
0d492ac
added one way test
304NotModified Jul 25, 2015
f1b53f8
fixed test for one-way, lowered waiting time
304NotModified Jul 25, 2015
5e59d0a
merge with master
304NotModified Jul 26, 2015
00ae58c
sync project files
304NotModified Jul 26, 2015
3f37242
re-enabled warnings = error,
304NotModified Aug 15, 2015
e8e6d58
docs
304NotModified Aug 15, 2015
fdb05c6
enabled cookiecontainer
304NotModified Aug 15, 2015
e6d8fcb
cleanup
304NotModified Aug 15, 2015
d79acc2
#if wcf_supported
304NotModified Aug 15, 2015
c2e49d9
fix createchannel for SL
304NotModified Aug 15, 2015
f2be59b
Fix SL
304NotModified Aug 15, 2015
ca2e922
fix include
304NotModified Aug 15, 2015
6269b35
fix .net 3.5 + 4.0
304NotModified Aug 15, 2015
3529dd1
merge with master
304NotModified Aug 15, 2015
649363d
add file header
304NotModified Aug 15, 2015
3caca67
merge
304NotModified Aug 23, 2015
ba4491c
Added a Base Class for Wcf Log Receivers
kevindaub Aug 24, 2015
90d84f3
Synced Projects
kevindaub Aug 24, 2015
71e7bfe
Fix Silverlight Compilation
kevindaub Aug 24, 2015
f8163b0
Fixed Base Class Constructor Calls
kevindaub Aug 24, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/NLog/LogReceiverService/ILogReceiverClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ namespace NLog.LogReceiverService
#if WCF_SUPPORTED
[ServiceContract(Namespace = LogReceiverServiceConfig.WebServiceNamespace, ConfigurationName = "NLog.LogReceiverService.ILogReceiverClient")]
#endif
[Obsolete("This may be removed in a future release. Use ILogReceiverOneWayClient or ILogReceiverTwoWayClient.")]
public interface ILogReceiverClient
{
/// <summary>
Expand All @@ -65,4 +66,4 @@ public interface ILogReceiverClient
/// <param name="result">The result.</param>
void EndProcessLogMessages(IAsyncResult result);
}
}
}
4 changes: 2 additions & 2 deletions src/NLog/LogReceiverService/ILogReceiverOneWayClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ public interface ILogReceiverOneWayClient
#if WCF_SUPPORTED
[OperationContractAttribute(IsOneWay = true, AsyncPattern = true, Action = "http://nlog-project.org/ws/ILogReceiverOneWayServer/ProcessLogMessages")]
#endif
IAsyncResult BeginProcessLogMessages(NLogEvents events, AsyncCallback callback, object asyncState);
IAsyncResult BeginProcessLogMessages(NLogEvents events, AsyncCallback callback, object asyncState);

/// <summary>
/// Ends asynchronous processing of log messages.
/// </summary>
/// <param name="result">The result.</param>
void EndProcessLogMessages(IAsyncResult result);
void EndProcessLogMessages(IAsyncResult result);
}
}
2 changes: 1 addition & 1 deletion src/NLog/LogReceiverService/ILogReceiverServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public interface ILogReceiverServer
/// Processes the log messages.
/// </summary>
/// <param name="events">The events.</param>
[OperationContract()]
[OperationContract]
void ProcessLogMessages(NLogEvents events);
}
}
Expand Down
68 changes: 68 additions & 0 deletions src/NLog/LogReceiverService/ILogReceiverTwoWayClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//
// Copyright (c) 2004-2011 Jaroslaw Kowalski <jaak@jkowalski.net>
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * Neither the name of Jaroslaw Kowalski nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
// THE POSSIBILITY OF SUCH DAMAGE.
//

namespace NLog.LogReceiverService
{
using System;
#if WCF_SUPPORTED
using System.ServiceModel;
#endif
/// <summary>
/// Service contract for Log Receiver client.
/// </summary>
#if WCF_SUPPORTED
[ServiceContract(Namespace = LogReceiverServiceConfig.WebServiceNamespace, ConfigurationName = "NLog.LogReceiverService.ILogReceiverClient")]
#endif
public interface ILogReceiverTwoWayClient
{
/// <summary>
/// Begins processing of log messages.
/// </summary>
/// <param name="events">The events.</param>
/// <param name="callback">The callback.</param>
/// <param name="asyncState">Asynchronous state.</param>
/// <returns>
/// IAsyncResult value which can be passed to <see cref="EndProcessLogMessages"/>.
/// </returns>
#if WCF_SUPPORTED
[OperationContractAttribute(AsyncPattern = true, Action = "http://nlog-project.org/ws/ILogReceiverServer/ProcessLogMessages", ReplyAction = "http://nlog-project.org/ws/ILogReceiverServer/ProcessLogMessagesResponse")]
#endif
IAsyncResult BeginProcessLogMessages(NLogEvents events, AsyncCallback callback, object asyncState);

/// <summary>
/// Ends asynchronous processing of log messages.
/// </summary>
/// <param name="result">The result.</param>
void EndProcessLogMessages(IAsyncResult result);
}
}
150 changes: 150 additions & 0 deletions src/NLog/LogReceiverService/IWcfLogReceiverClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
//
// Copyright (c) 2004-2011 Jaroslaw Kowalski <jaak@jkowalski.net>
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * Neither the name of Jaroslaw Kowalski nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
// THE POSSIBILITY OF SUCH DAMAGE.
//

#if WCF_SUPPORTED

using System;
using System.ComponentModel;
using System.Net;
using System.ServiceModel;
using System.ServiceModel.Description;

namespace NLog.LogReceiverService
{
/// <summary>
/// Client of <see cref="ILogReceiverServer"/>
/// </summary>
public interface IWcfLogReceiverClient : ICommunicationObject
{
/// <summary>
/// Occurs when the log message processing has completed.
/// </summary>
event EventHandler<AsyncCompletedEventArgs> ProcessLogMessagesCompleted;

/// <summary>
/// Occurs when Open operation has completed.
/// </summary>
event EventHandler<AsyncCompletedEventArgs> OpenCompleted;

/// <summary>
/// Occurs when Close operation has completed.
/// </summary>
event EventHandler<AsyncCompletedEventArgs> CloseCompleted;

/// <summary>
/// Enables the user to configure client and service credentials as well as service credential authentication settings for use on the client side of communication.
/// </summary>
ClientCredentials ClientCredentials { get; }

/// <summary>
/// Gets the underlying <see cref="IClientChannel"/> implementation.
/// </summary>
IClientChannel InnerChannel { get; }

/// <summary>
/// Gets the target endpoint for the service to which the WCF client can connect.
/// </summary>
ServiceEndpoint Endpoint { get; }

/// <summary>
/// Opens the client asynchronously.
/// </summary>
void OpenAsync();

/// <summary>
/// Opens the client asynchronously.
/// </summary>
/// <param name="userState">User-specific state.</param>
void OpenAsync(object userState);

/// <summary>
/// Closes the client asynchronously.
/// </summary>
void CloseAsync();

/// <summary>
/// Closes the client asynchronously.
/// </summary>
/// <param name="userState">User-specific state.</param>
void CloseAsync(object userState);

/// <summary>
/// Processes the log messages asynchronously.
/// </summary>
/// <param name="events">The events to send.</param>
void ProcessLogMessagesAsync(NLogEvents events);

/// <summary>
/// Processes the log messages asynchronously.
/// </summary>
/// <param name="events">The events to send.</param>
/// <param name="userState">User-specific state.</param>
void ProcessLogMessagesAsync(NLogEvents events, object userState);

/// <summary>
/// Begins processing of log messages.
/// </summary>
/// <param name="events">The events to send.</param>
/// <param name="callback">The callback.</param>
/// <param name="asyncState">Asynchronous state.</param>
/// <returns>
/// IAsyncResult value which can be passed to <see cref="ILogReceiverOneWayClient.EndProcessLogMessages"/>.
/// </returns>
IAsyncResult BeginProcessLogMessages(NLogEvents events, AsyncCallback callback, object asyncState);

/// <summary>
/// Ends asynchronous processing of log messages.
/// </summary>
/// <param name="result">The result.</param>
void EndProcessLogMessages(IAsyncResult result);

#if !SILVERLIGHT
/// <summary>
/// Instructs the inner channel to display a user interface if one is required to initialize the channel prior to using it.
/// </summary>
void DisplayInitializationUI();
#endif

#if !NET4_0 && !NET3_5

/// <summary>
/// Gets or sets the cookie container.
/// </summary>
/// <value>The cookie container.</value>
CookieContainer CookieContainer { get; set; }
#endif

}
}

#endif
Loading