We have a WCF-application that encapsulate several long running
proxies. In an environment with many concurrent calls to the service,
we run into errors like this:

"Method BeginActivityListRequest is not supported on this proxy, this
can happen if the method is not marked with OperationContractAttribute
or if the interface type is not marked with ServiceContractAttribute".
"BeginActivityListRequest" is an async call to a remote proxy created
by this class:

public class ClientProxyContainer
{
private static IWindsorContainer container;
static ProxyConfiguration proxyConfiguration = null;

private static object monitor = new object();
public static IWindsorContainer Create(ProxyConfiguration config)
{
if (container == null)
{
lock (monitor)
{
if (container == null)
{
proxyConfiguration = config;
InitContainer();
}
}
}
return container;
}
static void InitContainer()
{
container = new WindsorContainer();
container.AddFacility<WcfFacility>();
BasicHttpBinding binding = new
BasicHttpBinding(BasicHttpSecurityMode.Transport);
binding.MaxReceivedMessageSize = Int32.MaxValue;
binding.SendTimeout =
TimeSpan.FromSeconds(proxyConfiguration.SendTimeoutSec.ToDoubleOrDefault());
var services = new[]
{
typeof (ListBalance2Port),
//... several other proxies
typeof (ListReservationsPort),
};
foreach (var s in services)
{
container.Register(
Component.For(s).ActAs(new DefaultClientModel()
{
Endpoint =
WcfEndpoint.BoundTo(binding).At(proxyConfiguration.Endpoint)
}));
}
}
}

Typical use of the ClientProxyContainer:
var container = EdbClientProxyContainer.Create(proxyConfiguration);
service = container.Resolve<ActivityListPort>();
var asyncResult = service.BeginActivityListRequest(request);

This pattern has been running without errors on an earlier version of
WcfIntegration (1.0.3.0)/DynamicProxy2(2.0.3.0). When we upgraded to a
newer version of WcfIntegration based on DynamicProxy2(2.2.0.0), the
error popped up in our logs. It seem to me that invocation and
channelHolder gets mixed up, and the wrong method is called on the
proxy in WcfRemotingAsyncInterceptor.PerformInvocation.

Is this a known issue? Any workarounds?

Øystein

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to