add soap inspector
This commit is contained in:
parent
ebc973093e
commit
d60b6997de
@ -5,6 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="System.ServiceModel.Duplex" Version="4.4.*" />
|
||||
<PackageReference Include="System.ServiceModel.Http" Version="4.4.*" />
|
||||
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.4.*" />
|
||||
@ -15,4 +16,8 @@
|
||||
<WCFMetadata Include="Connected Services" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Inspector" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
35
ELT.Client/Inspector/InspectorBehavior.cs
Normal file
35
ELT.Client/Inspector/InspectorBehavior.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System.ServiceModel.Channels;
|
||||
using System.ServiceModel.Description;
|
||||
using System.ServiceModel.Dispatcher;
|
||||
|
||||
namespace ELT.Client.Inspector
|
||||
{
|
||||
public class InspectorBehavior : IEndpointBehavior
|
||||
{
|
||||
public MyMessageInspector myMessageInspector;
|
||||
public InspectorBehavior() { }
|
||||
public InspectorBehavior(MyMessageInspector myMessageInspector)
|
||||
{
|
||||
this.myMessageInspector = myMessageInspector;
|
||||
}
|
||||
public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
|
||||
{
|
||||
clientRuntime.ClientMessageInspectors.Add(this.myMessageInspector);
|
||||
}
|
||||
|
||||
public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Validate(ServiceEndpoint endpoint)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
20
ELT.Client/Inspector/MyMessageInspector.cs
Normal file
20
ELT.Client/Inspector/MyMessageInspector.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Dispatcher;
|
||||
|
||||
namespace ELT.Client.Inspector
|
||||
{
|
||||
public class MyMessageInspector : IClientMessageInspector
|
||||
{
|
||||
public string body;
|
||||
public void AfterReceiveReply(ref System.ServiceModel.Channels.Message reply, object correlationState)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, IClientChannel channel)
|
||||
{
|
||||
body = request.ToString();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -10,7 +10,7 @@ namespace ELT.Client.Managers.Insurance
|
||||
{
|
||||
public class KaskoManager : InsuranceManager<CalculateKaskoRequest, KASKOCalculationResult>
|
||||
{
|
||||
private readonly EltSoap _eltKaskoSoap;
|
||||
private readonly EltSoapClient _eltKaskoSoap;
|
||||
|
||||
public KaskoManager()
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user