예제 #1
0
        public static T CreateBusObj <T>(Guid sessionId, string uriPath) where T : ImplBase
        {
            try
            {
                int OperationTimeout = 300;
                // the next two values are only used if the binding is set to UsernameSslChannel
                bool   ValidateWcfCertificate = false;        // should the certificate be validated as coming from a known certificate authority
                string dnsIdentity            = string.Empty; // if the idenitity of the certificate does not match the machine name used in the url, you can specify it here.

                Guid SessionGuid = sessionId != null ? sessionId : Guid.Empty;

                T BO = ImplFactory.CreateImpl <T>(
                    uriPath,
                    appServerUrl: AppSrvUrl,
                    submitUser: string.Empty,
                    endpointBinding: EndpointBinding,
                    sessionId: SessionGuid,
                    userId: EpicorUserID,
                    password: EpiorUserPassword,
                    operationTimeout: OperationTimeout,
                    validateWcfCertificate: ValidateWcfCertificate,
                    dnsIdentity: dnsIdentity,
                    licenseTypeId: Ice.License.LicensableUserCounts.DefaultUser);

                return(BO);
            }
            catch (Exception ex)
            {
                throw new Ice.BLException(ex.Message.ToString());
            }
        }
예제 #2
0
        protected override void ImplSerialize(out IValueUnit retVal, InterfaceType instance, SerializationContextType context)
        {
            IHierarchicalMetadataProvider <IValueUnit, IValueItemBase> ctx = null;
            IValueUnit curCtxLvl = null;

            ctx       = context as IHierarchicalMetadataProvider <IValueUnit, IValueItemBase>;
            curCtxLvl = ctx.Hierarchy.Peek() as IValueUnit;

            if (curCtxLvl != null && ctx != null && ctx.Metadata != null)
            {
                curCtxLvl.Add("SerializationManager", GetType().AssemblyQualifiedName);
            }

            retVal = ImplFactory.Serialize(instance, context);
        } // End of ImplSerialize (...)
 protected override InterfaceType ImplDeserialize(
     SerializedType serialization,
     SerializationContextType context)
 => ImplFactory.Deserialize(serialization, context);