Skip to content

Commit

Permalink
Change WCF facility to remove use of obsolete method
Browse files Browse the repository at this point in the history
  • Loading branch information
jonorossi committed Sep 28, 2017
1 parent fd4cf60 commit fb85548
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/Castle.Facilities.WcfIntegration/WcfInvocation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2004-2011 Castle Project - http://www.castleproject.org/
// Copyright 2004-2017 Castle Project - http://www.castleproject.org/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -64,11 +64,19 @@ public WcfInvocation Refresh(bool force)
{
var oldChannel = channelHolder.Channel;
var channel = channelHolder.RefreshChannel(force);
if ((channel != oldChannel) && (invocation is IChangeProxyTarget))
if ((channel != oldChannel))
{
var changeTarget = (IChangeProxyTarget)invocation;
changeTarget.ChangeInvocationTarget(channel);
changeTarget.ChangeProxyTarget(channel);
var changeInvocation = invocation as IChangeProxyTarget;
if (changeInvocation != null)
{
changeInvocation.ChangeInvocationTarget(channel);
}

var changeProxy = invocation.Proxy as IProxyTargetAccessor;
if (changeProxy != null)
{
changeProxy.DynProxySetTarget(channel);
}
}
return this;
}
Expand Down

0 comments on commit fb85548

Please sign in to comment.