Ejemplo n.º 1
0
        /// <summary>
        /// Generates the ZY service wrapper type.
        /// </summary>
        protected virtual void GenerateProxy()
        {
            IProxyTypeBuilder builder = new ConfigurableServiceProxyTypeBuilder(
                TargetName, this.objectName, this.objectFactory, UseServiceProxyTypeCache, ContractInterface,
                Name, Namespace, ConfigurationName, CallbackContract, ProtectionLevel);

            builder.TypeAttributes   = TypeAttributes;
            builder.MemberAttributes = MemberAttributes;

            proxyType = builder.BuildProxyType();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Generates the WCF service wrapper type.
        /// </summary>
        protected virtual void GenerateProxy()
        {
            IProxyTypeBuilder builder = new ConfigurableServiceProxyTypeBuilder(
                TargetName, objectFactory.GetType(TargetName), this.objectName, _useServiceProxyTypeCache,
                Name, Namespace, ConfigurationName, CallbackContract, ProtectionLevel, SessionMode, this.objectFactory);

            if (ContractInterface != null)
            {
                builder.Interfaces = new Type[] { ContractInterface };
            }
            builder.TypeAttributes   = TypeAttributes;
            builder.MemberAttributes = MemberAttributes;

            if (builder.Interfaces.Length > 1)
            {
                throw new ArgumentException(String.Format(
                                                "ServiceExporter cannot export service type '{0}' as a WCF service because it implements multiple interfaces. Specify the contract interface to expose via the ContractInterface property.",
                                                builder.TargetType));
            }

            proxyType = builder.BuildProxyType();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Generates the WCF service wrapper type.
        /// </summary>
        protected virtual void GenerateProxy()
        {
            IProxyTypeBuilder builder = new ConfigurableServiceProxyTypeBuilder(
                TargetName, this.objectName, this.objectFactory, _useServiceProxyTypeCache, ContractInterface, 
                Name, Namespace, ConfigurationName, CallbackContract, ProtectionLevel, SessionMode);

            builder.TypeAttributes = TypeAttributes;
            builder.MemberAttributes = MemberAttributes;

            proxyType = builder.BuildProxyType();
        }