public PcaWampClient(Uri address, string realm, IWampClientAuthenticator authenticator, TypeMapper typeMapper)
        {
            var serializer = new Newtonsoft.Json.JsonSerializer();

            if (typeMapper != null)
            {
                serializer.Converters.Add(new DerivedEntityJsonConverter(typeMapper));
            }

            var builder =
                new WampChannelFactory().ConnectToRealm(realm)
                .WebSocketTransport(address)
                .JsonSerialization(serializer);

            this.channel = authenticator != null?
                           builder.Authenticator(authenticator).Build() :
                               builder.Build();
        }