-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from solarwinds/Madhavan-OrionSDK
Handling base64 encoding in swql studio
- Loading branch information
Showing
4 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.ServiceModel.Channels; | ||
using System.ServiceModel.Description; | ||
using System.ServiceModel.Dispatcher; | ||
using System.Text; | ||
|
||
namespace SolarWinds.InformationService.Contract2 | ||
{ | ||
class InfoServiceDefaultBehaviour : IEndpointBehavior, IClientMessageInspector | ||
{ | ||
private static readonly IDictionary<string, object> _defaultHeaderValue = new Dictionary<string, object>() | ||
{ | ||
{ "IsBase64EncodingAccepted", true } | ||
}; | ||
|
||
#region IEndpointBehavior Members | ||
|
||
public void AddBindingParameters(ServiceEndpoint endpoint, System.ServiceModel.Channels.BindingParameterCollection bindingParameters) | ||
{ | ||
} | ||
|
||
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) | ||
{ | ||
clientRuntime.MessageInspectors.Add(this); | ||
} | ||
|
||
public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Validate(ServiceEndpoint endpoint) | ||
{ | ||
} | ||
|
||
#endregion | ||
|
||
#region IClientMessageInspector Members | ||
|
||
public void AfterReceiveReply(ref System.ServiceModel.Channels.Message reply, object correlationState) | ||
{ | ||
} | ||
|
||
public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel) | ||
{ | ||
foreach (var kv in _defaultHeaderValue) | ||
{ | ||
if (request.Headers.FindHeader(kv.Key, Constants.Namespace) == -1) | ||
{ | ||
request.Headers.Add(MessageHeader.CreateHeader(kv.Key, Constants.Namespace, kv.Value)); | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters