Inheritance: IOperationBehavior, IWsdlExportExtension
        void IOperationContractGenerationExtension.GenerateOperation(OperationContractGenerationContext context)
        {
            DataContractSerializerOperationBehavior behavior  = context.Operation.Behaviors.Find <DataContractSerializerOperationBehavior>();
            DataContractFormatAttribute             attribute = (behavior == null) ? new DataContractFormatAttribute() : behavior.DataContractFormatAttribute;
            OperationFormatStyle style = attribute.Style;

            this.operationGenerator.GenerateOperation(context, ref style, false, new WrappedBodyTypeGenerator(this, context), this.knownTypes);
            attribute.Style = style;
            if (attribute.Style != TypeLoader.DefaultDataContractFormatAttribute.Style)
            {
                context.SyncMethod.CustomAttributes.Add(System.ServiceModel.Description.OperationGenerator.GenerateAttributeDeclaration(context.Contract.ServiceContractGenerator, attribute));
            }
            if (this.knownTypes != null)
            {
                Dictionary <CodeTypeReference, object> operationKnownTypes = new Dictionary <CodeTypeReference, object>(new CodeTypeReferenceComparer());
                foreach (MessageDescription description in context.Operation.Messages)
                {
                    foreach (MessagePartDescription description2 in description.Body.Parts)
                    {
                        this.AddKnownTypesForPart(context, description2, operationKnownTypes);
                    }
                    foreach (MessageHeaderDescription description3 in description.Headers)
                    {
                        this.AddKnownTypesForPart(context, description3, operationKnownTypes);
                    }
                    if (OperationFormatter.IsValidReturnValue(description.Body.ReturnValue))
                    {
                        this.AddKnownTypesForPart(context, description.Body.ReturnValue, operationKnownTypes);
                    }
                }
            }
            UpdateTargetCompileUnit(context, this.codeCompileUnit);
        }
Exemplo n.º 2
0
        public void ApplyContractExtensions(ServiceEndpoint endpoint)
        {
            var contract = endpoint.Contract;
            foreach (var extension in Extensions)
            {
                var operationDescriptions = contract.Operations.Find(extension.Metadata.FunctionName);

                if (operationDescriptions != null)
                {
                    var serializerBehavior = operationDescriptions.Behaviors.Find<DataContractSerializerOperationBehavior>();
                    if (serializerBehavior == null)
                    {
                        serializerBehavior = new DataContractSerializerOperationBehavior(operationDescriptions);
                        operationDescriptions.Behaviors.Add(serializerBehavior);
                    }
                    serializerBehavior.DataContractResolver = extension.Value.GetResolver();
                }
                else
                {
                    Logger.Log(string.Format("No operation descriptions found for function name: {0}", extension.Metadata.FunctionName);
                }

            }

        }
Exemplo n.º 3
0
 private static bool GetStyleAndUse(OperationDescription operation, Type messageContractExporterType, out bool isRpc, out bool isEncoded)
 {
     isRpc = isEncoded = false;
     if ((messageContractExporterType == typeof(DataContractSerializerMessageContractExporter)) || (messageContractExporterType == null))
     {
         DataContractSerializerOperationBehavior behavior = operation.Behaviors.Find <DataContractSerializerOperationBehavior>();
         if (behavior != null)
         {
             isRpc     = behavior.DataContractFormatAttribute.Style == OperationFormatStyle.Rpc;
             isEncoded = false;
             return(true);
         }
         if (messageContractExporterType == typeof(DataContractSerializerMessageContractExporter))
         {
             return(false);
         }
     }
     if ((messageContractExporterType == typeof(XmlSerializerMessageContractExporter)) || (messageContractExporterType == null))
     {
         XmlSerializerOperationBehavior behavior2 = operation.Behaviors.Find <XmlSerializerOperationBehavior>();
         if (behavior2 != null)
         {
             isRpc     = behavior2.XmlSerializerFormatAttribute.Style == OperationFormatStyle.Rpc;
             isEncoded = behavior2.XmlSerializerFormatAttribute.IsEncoded;
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Changes the data contract serializer used on a service operation.
        /// </summary>
        /// <param name="operationDescription"></param>
        public static void ReplaceDataContractSerializer(OperationDescription operationDescription)
        {
            if (operationDescription == null)
            {
                throw new ArgumentNullException("operationDescription");
            }

            System.ServiceModel.Description.DataContractSerializerOperationBehavior
                dataContractSerializerOperationBehavior =
                operationDescription.Behaviors
                .Find <System.ServiceModel.Description.DataContractSerializerOperationBehavior>();

            if (dataContractSerializerOperationBehavior != null)
            {
                // Remove old behavior
                operationDescription.Behaviors.Remove(dataContractSerializerOperationBehavior);

                // Add custom data contract resolver
                dataContractSerializerOperationBehavior.DataContractResolver = new DataContractResolver();
            }

            // Add custom behavior
            if (operationDescription.Behaviors.Find <DataContractSerializerOperationBehavior>() == null)
            {
                operationDescription.Behaviors.Add(new DataContractSerializerOperationBehavior(operationDescription));
            }
        }
        // Assumption: gets called exactly once per operation
        void IOperationContractGenerationExtension.GenerateOperation(OperationContractGenerationContext context)
        {
            DataContractSerializerOperationBehavior DataContractSerializerOperationBehavior = context.Operation.Behaviors.Find <DataContractSerializerOperationBehavior>() as DataContractSerializerOperationBehavior;
            DataContractFormatAttribute             dataContractFormatAttribute             = (DataContractSerializerOperationBehavior == null) ? new DataContractFormatAttribute() : DataContractSerializerOperationBehavior.DataContractFormatAttribute;
            OperationFormatStyle style = dataContractFormatAttribute.Style;

            operationGenerator.GenerateOperation(context, ref style, false /*isEncoded*/, new WrappedBodyTypeGenerator(this, context), knownTypes);
            dataContractFormatAttribute.Style = style;
            if (dataContractFormatAttribute.Style != TypeLoader.DefaultDataContractFormatAttribute.Style)
            {
                context.SyncMethod.CustomAttributes.Add(OperationGenerator.GenerateAttributeDeclaration(context.Contract.ServiceContractGenerator, dataContractFormatAttribute));
            }
            if (knownTypes != null)
            {
                Dictionary <CodeTypeReference, object> operationKnownTypes = new Dictionary <CodeTypeReference, object>(new CodeTypeReferenceComparer());
                foreach (MessageDescription message in context.Operation.Messages)
                {
                    foreach (MessagePartDescription part in message.Body.Parts)
                    {
                        AddKnownTypesForPart(context, part, operationKnownTypes);
                    }
                    foreach (MessageHeaderDescription header in message.Headers)
                    {
                        AddKnownTypesForPart(context, header, operationKnownTypes);
                    }
                    if (OperationFormatter.IsValidReturnValue(message.Body.ReturnValue))
                    {
                        AddKnownTypesForPart(context, message.Body.ReturnValue, operationKnownTypes);
                    }
                }
            }
            UpdateTargetCompileUnit(context, this.codeCompileUnit);
        }
 public DataContractSerializerOperationFormatter(OperationDescription description, DataContractFormatAttribute dataContractFormatAttribute, DataContractSerializerOperationBehavior serializerFactory) : base(description, dataContractFormatAttribute.Style == OperationFormatStyle.Rpc, false)
 {
     if (description == null)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("description");
     }
     this.serializerFactory = serializerFactory ?? new DataContractSerializerOperationBehavior(description);
     foreach (System.Type type in description.KnownTypes)
     {
         if (this.knownTypes == null)
         {
             this.knownTypes = new List<System.Type>();
         }
         if (type == null)
         {
             throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("SFxKnownTypeNull", new object[] { description.Name })));
         }
         this.ValidateDataContractType(type);
         this.knownTypes.Add(type);
     }
     this.requestMessageInfo = this.CreateMessageInfo(dataContractFormatAttribute, base.RequestDescription, this.serializerFactory);
     if (base.ReplyDescription != null)
     {
         this.replyMessageInfo = this.CreateMessageInfo(dataContractFormatAttribute, base.ReplyDescription, this.serializerFactory);
     }
 }
Exemplo n.º 7
0
        private static ServiceHost Start()
        {
            var sh = new ServiceHost(typeof(MyService2));
            sh.Closing += SVClose;
            sh.Open();

            sh = new ServiceHost(typeof(MyService));
            sh.Closing += SVClose;
            sh.Open();

            sh = new ServiceHost(typeof(CommonCRUDService));
            var cd = sh.Description.Endpoints[0].Contract;
            //查找的是需要更改数据契约
            var myOperationDescription = cd.Operations.Find("Add");

            var serializerBehavior = myOperationDescription.Behaviors.Find<DataContractSerializerOperationBehavior>();
            if (serializerBehavior == null)
            {
                serializerBehavior = new DataContractSerializerOperationBehavior(myOperationDescription);
                myOperationDescription.Behaviors.Add(serializerBehavior);
            }
            serializerBehavior.DataContractResolver = new MyDataContractResolver(typeof(CommonCRUDService).Assembly);

            sh.Open();
            //var result = PolicyInjection.Create<MyService>();
            ////var result = PolicyInjection.Wrap<MyService>(serviceInstance);
            //result.DoWork();

            return sh;
        }
 public CompressionMessageFormatter(CompressionAlgorithm algorithm, OperationDescription description, DataContractFormatAttribute dataContractFormatAttribute, DataContractSerializerOperationBehavior serializerFactory)
 {
     this.MessageCompressor = new MessageCompressor(algorithm);
     Type innerFormatterType = Type.GetType(DataContractSerializerOperationFormatterTypeName);
     var innerFormatter = Activator.CreateInstance(innerFormatterType, description, dataContractFormatAttribute, serializerFactory);
     this.InnerClientMessageFormatter = innerFormatter as IClientMessageFormatter;
     this.InnerDispatchMessageFormatter = innerFormatter as IDispatchMessageFormatter;
 }
        internal static IDispatchMessageFormatter GetDispatcherFormatterFromRuntime(OperationDescription operationDescription)
        {
            System.ServiceModel.Dispatcher.DispatchOperation dispatchOperation = new System.ServiceModel.Dispatcher.DispatchOperation(DummyDispatchRuntime, operationDescription.Name, operationDescription.Messages[0].Action);
            IOperationBehavior operationBehavior = new DataContractSerializerOperationBehavior(operationDescription);
            operationBehavior.ApplyDispatchBehavior(operationDescription, dispatchOperation);

            return dispatchOperation.Formatter;
        }
Exemplo n.º 10
0
        public static void Main(string[] argv)
        {
            AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) =>
            {
                Exception ex = ((Exception)e.ExceptionObject);
                Console.WriteLine("Domain: {0}: {1}: Unhandled Exception: {2}\n{3}", DateTime.Now, sender ?? "(null)", ex.GetType().FullName, ex);
            };
            AppDomain.CurrentDomain.AssemblyLoad += (object sender, AssemblyLoadEventArgs args) =>
            {
                Console.WriteLine("Domain: {0}: {1}: Load Assembly: {2}", DateTime.Now, sender, args.LoadedAssembly.GetName());
            };
            AppDomain.CurrentDomain.DomainUnload += (object sender, EventArgs e) =>
            {
                Console.WriteLine("Domain: {0}: {1}: Domain Unload", DateTime.Now, sender ?? "(null)");
            };
            AppDomain.CurrentDomain.ProcessExit += (object sender, EventArgs e) =>
            {
                Console.WriteLine("Domain: {0}: {1}: Process Exit", DateTime.Now, sender ?? "(null)");
            };

            ProcessArgs(argv);
            //			AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => Assembly.LoadFile(args.);
            using (Host = new ServiceHost(typeof(TraceService)))
            {
                Host.OpenTimeout = Host.CloseTimeout = Timeout;
                ServiceEndpoint epTraceService = Host.AddServiceEndpoint(typeof(ITraceService), Binding, BaseUri);

                foreach (OperationDescription op in epTraceService.Contract.Operations)
                {
                    DataContractSerializerOperationBehavior dcsob = op.Behaviors.Find<DataContractSerializerOperationBehavior>();
                    if (dcsob == null)
                        op.Behaviors.Add(dcsob = new DataContractSerializerOperationBehavior(op, new DataContractFormatAttribute() { }));
                    dcsob.DataContractSurrogate = new TraceServiceSurrogate();			//			dcsob.DataContractResolver = new System.Runtime.Serialization.DataContractResolver
                }

                Host.Opening += (sender, e) => {
                    Console.WriteLine("Service: {0}: {1}: Opening: {2}{3}: {4}", DateTime.Now, sender.ToString(),
                        Host.Description.Namespace, Host.Description.Name, Host.Description.ServiceType.FullName);
                    foreach (Uri baseUri in Host.BaseAddresses)
                        Console.WriteLine("    Base Address: {0}", Host.BaseAddresses[0]);
                    foreach (ServiceEndpoint endpoint in Host.Description.Endpoints)
                        Console.WriteLine("    Endpoint: {0}{1} {2}", endpoint.Contract.Namespace, endpoint.Contract.Name, endpoint.Address.Uri.ToString());
                };
                Host.Opened += (sender, e) => Console.WriteLine("Service: {0}: {1}: Opened", DateTime.Now, sender.ToString());
                Host.Closing += (sender, e) => Console.WriteLine("Service: {0}: {1}: Closing", DateTime.Now, sender.ToString());
                Host.Closed += (sender, e) => Console.WriteLine("Service: {0}: {1}: Closed", DateTime.Now, sender.ToString());
                Host.UnknownMessageReceived += (sender, e) => Console.WriteLine("Service: {0}: {1}: UnknownMessageReceived: {2}", DateTime.Now, sender.ToString(), e.Message.ToString());

                Host.Open();
            //				while (Host.State == CommunicationState.Opening || Host.State == CommunicationState.Opened)
            //				{
                    Thread.Sleep(HostThreadLoopDelay);
            //				}
                Process.GetCurrentProcess().WaitForExit();
            }
        }
Exemplo n.º 11
0
 /// <summary>
 /// Applies the type resolver behavior to an
 /// operation
 /// </summary>
 /// <param name="desc">
 /// The WCF operation description
 /// </param>
 protected override void ApplyOperationBehavior(OperationDescription desc)
 {
     DataContractSerializerOperationBehavior dcsob =
     desc.Behaviors.Find<DataContractSerializerOperationBehavior>();
      if (dcsob == null)
     desc.Behaviors.Add(
        dcsob = new DataContractSerializerOperationBehavior(desc)
     );
      dcsob.DataContractResolver = this.resolver;
 }
 internal JsonQueryStringConverter(OperationDescription operationDescription)
     : base()
 {
     if (operationDescription == null)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("operationDescription");
     }
     this.operationDescription = operationDescription;
     this.dataContractSerializerOperationBehavior = this.operationDescription.Behaviors.Find<DataContractSerializerOperationBehavior>();
 }
Exemplo n.º 13
0
        private static void ConfigureService(Type iface, ServiceHost host)
        {
            var proxyConfig = ProxyConfiguration.Create(new Config(), iface.Name.Substring(1));

            //host.Authorization.ServiceAuthorizationManager = new CompanyNameServiceAuthorizationManager();

            var ep = host.AddServiceEndpoint(iface, new BindingFactory().CreateBinding(proxyConfig), string.Empty);

            //ep.Behaviors.Add(new ContextPropagator());

            if (proxyConfig.BindingType == typeof(WebHttpBinding))
            {
                ep.Behaviors.Add(new WebHttpBehavior());
            }

            foreach (var op in ep.Contract.Operations)
            {
                var dataContract = op.Behaviors.Find<DataContractSerializerOperationBehavior>();

                if (dataContract == null)
                {
                    dataContract = new DataContractSerializerOperationBehavior(op) { MaxItemsInObjectGraph = proxyConfig.MaxItemsInObjectGraph };
                    op.Behaviors.Add(dataContract);
                }
                else
                {
                    dataContract.MaxItemsInObjectGraph = proxyConfig.MaxItemsInObjectGraph;
                }
            }

            var serviceDebugBehavior = host.Description.Behaviors.Find<ServiceDebugBehavior>();

            if (serviceDebugBehavior == null)
            {
                serviceDebugBehavior = new ServiceDebugBehavior { IncludeExceptionDetailInFaults = proxyConfig.IncludeExceptionDetailInFaults };
                host.Description.Behaviors.Add(serviceDebugBehavior);
            }
            else
            {
                serviceDebugBehavior.IncludeExceptionDetailInFaults = proxyConfig.IncludeExceptionDetailInFaults;
            }

            var metadataBehavior = host.Description.Behaviors.Find<ServiceMetadataBehavior>();

            if (metadataBehavior == null)
            {
                metadataBehavior = new ServiceMetadataBehavior { HttpGetEnabled = true };
                host.Description.Behaviors.Add(metadataBehavior);
            }
            else
            {
                metadataBehavior.HttpGetEnabled = true;
            }
        }
Exemplo n.º 14
0
 public static void AttachDataResolver(this ServiceEndpoint endpoint)
 {
     ContractDescription cd = endpoint.Contract;
     foreach (var operation in cd.Operations)
     {
         var serializerBehavior = operation.Behaviors.Find<DataContractSerializerOperationBehavior>();
         if (serializerBehavior == null)
         {
             serializerBehavior = new DataContractSerializerOperationBehavior(operation);
             operation.Behaviors.Add(serializerBehavior);
         }
         serializerBehavior.DataContractResolver = new SharedTypeResolver();
     }
 }
Exemplo n.º 15
0
        internal static NetDataContractSerializerOperationBehavior ApplyTo(OperationDescription operation)
        {
            NetDataContractSerializerOperationBehavior item      = null;
            DataContractSerializerOperationBehavior    behavior2 = operation.Behaviors.Find <DataContractSerializerOperationBehavior>();

            if (behavior2 != null)
            {
                item = new NetDataContractSerializerOperationBehavior(operation);
                operation.Behaviors.Remove(behavior2);
                operation.Behaviors.Add(item);
                return(item);
            }
            return(null);
        }
        private void ReplaceSerializerOperationBehavior(OperationDescription description)
        {
            DataContractSerializerOperationBehavior dcs = description.Behaviors.Find<DataContractSerializerOperationBehavior>();

            if (dcs != null)
            {
                dcs.DataContractSurrogate = Activator.CreateInstance(m_SurrogatedType) as IDataContractSurrogate;
            }
            else
            {
                dcs = new DataContractSerializerOperationBehavior(description);
                dcs.DataContractSurrogate = Activator.CreateInstance(m_SurrogatedType) as IDataContractSurrogate;
                description.Behaviors.Add(dcs);
            }
        }
        internal static NetDataContractSerializerOperationBehavior ApplyTo(OperationDescription operation)
        {
            NetDataContractSerializerOperationBehavior netDataContractSerializerOperationBehavior = null;
            DataContractSerializerOperationBehavior    dataContractSerializerOperationBehavior    = operation.Behaviors.Find <DataContractSerializerOperationBehavior>();

            if (dataContractSerializerOperationBehavior != null)
            {
                netDataContractSerializerOperationBehavior = new NetDataContractSerializerOperationBehavior(operation);
                operation.Behaviors.Remove(dataContractSerializerOperationBehavior);
                operation.Behaviors.Add(netDataContractSerializerOperationBehavior);

                return(netDataContractSerializerOperationBehavior);
            }

            return(null);
        }
Exemplo n.º 18
0
        private void AttachDataContractResolver(ServiceEndpoint endpoint)
        {
            ContractDescription cd = endpoint.Contract;

            foreach (OperationDescription operationDescription in cd.Operations)
            {
                DataContractSerializerOperationBehavior serializerBehavior =
                    operationDescription.Behaviors.Find<DataContractSerializerOperationBehavior>();

                if (serializerBehavior == null)
                {
                    serializerBehavior = new DataContractSerializerOperationBehavior(operationDescription);
                    operationDescription.Behaviors.Add(serializerBehavior);
                }
                serializerBehavior.DataContractResolver = new SchedulerTaskDataContractResolver();
            }
        }
 public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     foreach (OperationDescription op in endpoint.Contract.Operations)
     {
         DataContractSerializerOperationBehavior dataContractBehavior = op.Behaviors.Find<DataContractSerializerOperationBehavior>() as DataContractSerializerOperationBehavior;
         if (dataContractBehavior != null)
         {
             dataContractBehavior.DataContractSurrogate = new BinarySurrogate(typeProvider, surrogateConverter);
         }
         else
         {
             dataContractBehavior = new DataContractSerializerOperationBehavior(op);
             dataContractBehavior.DataContractSurrogate = new BinarySurrogate(typeProvider, surrogateConverter);
             op.Behaviors.Add(dataContractBehavior);
         }
     }
 }
        internal static void AddToEndpoints(IEnumerable<ServiceEndpoint> endpoints)
        {
            var operations = endpoints
                .Select(endpoint => endpoint.Contract)
                .SelectMany(contract => contract.Operations);

            foreach (var operation in operations)
            {
                var behavior = operation.Behaviors.Find<DataContractSerializerOperationBehavior>();
                if (behavior == null)
                {
                    behavior = new DataContractSerializerOperationBehavior(operation);
                    operation.Behaviors.Add(behavior);
                }

                behavior.DataContractResolver = new BusReceiverDataContractResolver();
            }
        }
 private void ConfigureOperationDescriptionBehaviors(OperationDescription operation, IDataContractSurrogate contractSurrogate)
 {
     DataContractSerializerOperationBehavior item = new DataContractSerializerOperationBehavior(operation, TypeLoader.DefaultDataContractFormatAttribute);
     if (contractSurrogate != null)
     {
         item.DataContractSurrogate = contractSurrogate;
     }
     operation.Behaviors.Add(item);
     operation.Behaviors.Add(new OperationInvokerBehavior());
     if ((this.info.TransactionOption == TransactionOption.Supported) || (this.info.TransactionOption == TransactionOption.Required))
     {
         operation.Behaviors.Add(new TransactionFlowAttribute(TransactionFlowOption.Allowed));
     }
     OperationBehaviorAttribute attribute = new OperationBehaviorAttribute {
         TransactionAutoComplete = true,
         TransactionScopeRequired = false
     };
     operation.Behaviors.Add(attribute);
 }
        internal static IClientMessageFormatter GetFormatterFromRuntime(OperationDescription operationDescription)
        {
            System.ServiceModel.Dispatcher.ClientOperation clientOperation = new System.ServiceModel.Dispatcher.ClientOperation(DummyClientRuntime, operationDescription.Name, operationDescription.Messages[0].Action);

            // Default to DataContractSerializerOperationBehavior
            if (operationDescription.Behaviors.Count == 0)
            {
                IOperationBehavior operationBehavior = new DataContractSerializerOperationBehavior(operationDescription);
                operationBehavior.ApplyClientBehavior(operationDescription, clientOperation);
            }
            else
            {
                foreach (IOperationBehavior operationBehavior in operationDescription.Behaviors)
                {
                    operationBehavior.ApplyClientBehavior(operationDescription, clientOperation);
                }
            }

            return clientOperation.Formatter;
        }
        public SingleBodyParameterDataContractMessageFormatter(OperationDescription operation, Type parameterType, bool isRequestFormatter, bool useJsonFormat, DataContractSerializerOperationBehavior dcsob)
            : base(operation, isRequestFormatter, "DataContractSerializer")
        {
            if (operation == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("operation");
            }
            if (parameterType == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("parameterType");
            }
            if (dcsob == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("dcsob");
            }
            this.parameterDataContractType = DataContractSerializerOperationFormatter.GetSubstituteDataContractType(parameterType, out isQueryable);
            this.isParameterCollectionInterfaceDataContract = IsTypeCollectionInterface(this.parameterDataContractType);
            List<Type> tmp = new List<Type>();
            if (operation.KnownTypes != null)
            {
                foreach (Type knownType in operation.KnownTypes)
                {
                    tmp.Add(knownType);
                }
            }
            Type nullableType = UnwrapNullableType(this.parameterDataContractType);
            if (nullableType != this.parameterDataContractType)
            {
                tmp.Add(nullableType);
            }
            this.surrogate = dcsob.DataContractSurrogate;
            this.ignoreExtensionData = dcsob.IgnoreExtensionDataObject;
            this.maxItemsInObjectGraph = dcsob.MaxItemsInObjectGraph;
            this.knownTypes = tmp.AsReadOnly();
            ValidateType(this.parameterDataContractType, surrogate, this.knownTypes);

            this.useJsonFormat = useJsonFormat;
            CreateInputSerializers(this.parameterDataContractType);

            thisLock = new Object();
        }
        public DataContractSerializerOperationFormatter(OperationDescription description, DataContractFormatAttribute dataContractFormatAttribute,
            DataContractSerializerOperationBehavior serializerFactory)
            : base(description, dataContractFormatAttribute.Style == OperationFormatStyle.Rpc, false/*isEncoded*/)
        {
            if (description == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("description");

            _serializerFactory = serializerFactory ?? new DataContractSerializerOperationBehavior(description);
            foreach (Type type in description.KnownTypes)
            {
                if (_knownTypes == null)
                    _knownTypes = new List<Type>();
                if (type == null)
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxKnownTypeNull, description.Name)));
                ValidateDataContractType(type);
                _knownTypes.Add(type);
            }
            requestMessageInfo = CreateMessageInfo(dataContractFormatAttribute, RequestDescription, _serializerFactory);
            if (ReplyDescription != null)
                replyMessageInfo = CreateMessageInfo(dataContractFormatAttribute, ReplyDescription, _serializerFactory);
        }
Exemplo n.º 25
0
        static void Main(string[] args)
        {
            var logger = LogManager.GetLogger("Client");
            //MyService.MyServiceClient client = new MyServiceClient();
            //client.DoWork();
            try
            {
                

                var client = new CommonCRUDService.CommonCRUDServiceClient();
                var cd = client.Endpoint.Contract;
                //查找的是需要更改数据契约
                var myOperationDescription = cd.Operations.Find("Add");

                var serializerBehavior = myOperationDescription.Behaviors.Find<DataContractSerializerOperationBehavior>();
                if (serializerBehavior == null)
                {
                    serializerBehavior = new DataContractSerializerOperationBehavior(myOperationDescription);
                    myOperationDescription.Behaviors.Add(serializerBehavior);
                }
                serializerBehavior.DataContractResolver = new MyDataContractResolver(typeof(ICommonCRUDService).Assembly);

                client.Add(new BusinessEntity() { Code = "MyBizDTO", Name = "MYDTO" });
                client.Close();

                //CodeTimer.Initialize();
                //CodeTimer.Time("预热", 1, SVInvoke);
                //CodeTimer.Time("1000次服务执行", 1000, SVInvoke);
                //SVInvoke();
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
            Console.ReadLine();

        }
Exemplo n.º 26
0
 public DataContractSerializerOperationBehaviorExtended(DataContractSerializerOperationBehavior inner,
                                                         OperationDescription operation)
     : base(operation, inner.DataContractFormatAttribute)
 {
     this.DataContractSurrogate = inner.DataContractSurrogate;
     this.IgnoreExtensionDataObject = inner.IgnoreExtensionDataObject;
     this.MaxItemsInObjectGraph = inner.MaxItemsInObjectGraph;
 }
Exemplo n.º 27
0
 /// <summary>
 /// 处理当前主机节点,将当前节点做为服务HOST启动
 /// </summary>
 /// <param name="node">当前主机节点</param>
 private void ProcessNode(NetNode node)
 {
     if (node.Info != null && !string.IsNullOrEmpty(node.Info.Url))
     {
         ServiceHost host = new ServiceHost(typeof(SyncService));
         //if (host.State == CommunicationState.Created)
         //{
         //    _logger.Info(string.Format("主机节点{0}已启动", node.Info.Url));
         //    return;
         //}
         NetTcpBinding binding = new NetTcpBinding("SyncBinding");
         host.AddServiceEndpoint(typeof(ISyncService), binding, node.Info.Url);
         ContractDescription cd = host.Description.Endpoints[0].Contract;
         OperationDescription myOperationDescription = cd.Operations.Find("Excute");
         DataContractSerializerOperationBehavior serializerBehavior = myOperationDescription.Behaviors.Find<DataContractSerializerOperationBehavior>();
         if (serializerBehavior == null)
         {
             serializerBehavior = new DataContractSerializerOperationBehavior(myOperationDescription);
             myOperationDescription.Behaviors.Add(serializerBehavior);
         }
         serializerBehavior.MaxItemsInObjectGraph = 1000000000;
         ServiceDebugBehavior behavior = host.Description.Behaviors.Find<ServiceDebugBehavior>();
         if (behavior == null)
         {
             behavior = new ServiceDebugBehavior();
             host.Description.Behaviors.Add(behavior);
         }
         behavior.IncludeExceptionDetailInFaults = true;
         host.Opened += (obj, e) => { _logger.Info(string.Format("主机节点{0}已启动", node.Info.Url)); };
         host.Open();
     }
     else
     {
         _logger.Error("没有找到可用于启动的主机节点");
     }
 }
Exemplo n.º 28
0
 internal override DataContractJsonSerializerOperationFormatter CreateDataContractJsonSerializerOperationFormatter(OperationDescription od, DataContractSerializerOperationBehavior dcsob, bool isWrapped)
 {
     return(new DataContractJsonSerializerOperationFormatter(od, dcsob.MaxItemsInObjectGraph, dcsob.IgnoreExtensionDataObject, dcsob.DataContractSurrogate, isWrapped, true, this.JavascriptCallbackParameterName));
 }
Exemplo n.º 29
0
        static void Main(string[] args)
        {
            using (ServiceHost host = new ServiceHost(typeof(WcfServiceLibrary1.Service1)))
            {
                // surrogate definition..
                foreach (ServiceEndpoint ep in host.Description.Endpoints)
                {
                    foreach (OperationDescription op in ep.Contract.Operations)
                    {
                        DataContractSerializerOperationBehavior dataContractBehavior =
                            op.Behaviors.Find<DataContractSerializerOperationBehavior>()
                            as DataContractSerializerOperationBehavior;
                        if (dataContractBehavior != null)
                        {
                            dataContractBehavior.DataContractSurrogate = new valToTransferAsBytes();
                        }
                        else
                        {
                            dataContractBehavior = new DataContractSerializerOperationBehavior(op);
                            dataContractBehavior.DataContractSurrogate = new valToTransferAsBytes();
                            op.Behaviors.Add(dataContractBehavior);
                        }
                    }
                }

                // set up exporter with surrogate definition..
                WsdlExporter exporter = new WsdlExporter();
                object dataContractExporter;
                XsdDataContractExporter xsdInventoryExporter;
                if (!exporter.State.TryGetValue(typeof(XsdDataContractExporter),
                    out dataContractExporter))
                {
                    xsdInventoryExporter = new XsdDataContractExporter(exporter.GeneratedXmlSchemas);
                }
                else
                    xsdInventoryExporter = (XsdDataContractExporter)dataContractExporter;
                exporter.State.Add(typeof(XsdDataContractExporter), xsdInventoryExporter);


                if (xsdInventoryExporter.Options == null)
                    xsdInventoryExporter.Options = new ExportOptions();
                xsdInventoryExporter.Options.DataContractSurrogate = new valToTransferAsBytes();

                // export the endpoints..

                

                ServiceEndpointCollection sec = host.Description.Endpoints;
                foreach (ServiceEndpoint se in sec)
                {
                    Console.WriteLine(se.Name);
                    exporter.ExportEndpoint(se);
                }

                MetadataSet docs = null;
                docs = exporter.GetGeneratedMetadata();

                host.Description.


                host.Open();

                PrintDescription(host);

                Console.WriteLine("The Trading Service is available.  Press any key to exit.");
                Console.ReadKey();

                host.Close();
            }

        }
Exemplo n.º 30
0
		public DataContractMessagesFormatter (OperationDescription desc, DataContractFormatAttribute attr)
			: base (desc)
		{
#if !NET_2_1
			this.serializerBehavior = desc.Behaviors.Find<DataContractSerializerOperationBehavior>();
#endif
			this.attr = attr;
		}
 internal override DataContractJsonSerializerOperationFormatter CreateDataContractJsonSerializerOperationFormatter(OperationDescription od, DataContractSerializerOperationBehavior dcsob, bool isWrapped)
 {
     return new DataContractJsonSerializerOperationFormatter(od, dcsob.MaxItemsInObjectGraph, dcsob.IgnoreExtensionDataObject, dcsob.DataContractSurrogate, isWrapped, true, this.JavascriptCallbackParameterName);
 }
 public XmlRpcOperationFormatterBehavior(DataContractSerializerOperationBehavior dcs, XmlSerializerOperationBehavior xcs)
 {
     _dcs = dcs;
     _xcs = xcs;
 }
 internal override void SetOperationStyle(OperationDescription operation, OperationFormatStyle style)
 {
     DataContractSerializerOperationBehavior operationBehavior = operation.Behaviors.Find<DataContractSerializerOperationBehavior>();
     if (operationBehavior == null)
     {
         operationBehavior = new DataContractSerializerOperationBehavior(operation, new DataContractFormatAttribute());
         operation.Behaviors.Add(operationBehavior);
     }
     operationBehavior.DataContractFormatAttribute.Style = style;
 }
 private MessageInfo CreateMessageInfo(DataContractFormatAttribute dataContractFormatAttribute, MessageDescription messageDescription, DataContractSerializerOperationBehavior serializerFactory)
 {
     if (messageDescription.IsUntypedMessage)
     {
         return null;
     }
     MessageInfo info = new MessageInfo();
     MessageBodyDescription body = messageDescription.Body;
     if (body.WrapperName != null)
     {
         info.WrapperName = base.AddToDictionary(body.WrapperName);
         info.WrapperNamespace = base.AddToDictionary(body.WrapperNamespace);
     }
     MessagePartDescriptionCollection parts = body.Parts;
     info.BodyParts = new PartInfo[parts.Count];
     for (int i = 0; i < parts.Count; i++)
     {
         info.BodyParts[i] = this.CreatePartInfo(parts[i], dataContractFormatAttribute.Style, serializerFactory);
     }
     if (OperationFormatter.IsValidReturnValue(messageDescription.Body.ReturnValue))
     {
         info.ReturnPart = this.CreatePartInfo(messageDescription.Body.ReturnValue, dataContractFormatAttribute.Style, serializerFactory);
     }
     info.HeaderDescriptionTable = new OperationFormatter.MessageHeaderDescriptionTable();
     info.HeaderParts = new PartInfo[messageDescription.Headers.Count];
     for (int j = 0; j < messageDescription.Headers.Count; j++)
     {
         MessageHeaderDescription message = messageDescription.Headers[j];
         if (message.IsUnknownHeaderCollection)
         {
             info.UnknownHeaderDescription = message;
         }
         else
         {
             this.ValidateDataContractType(message.Type);
             info.HeaderDescriptionTable.Add(message.Name, message.Namespace, message);
         }
         info.HeaderParts[j] = this.CreatePartInfo(message, OperationFormatStyle.Document, serializerFactory);
     }
     info.AnyHeaders = (info.UnknownHeaderDescription != null) || (info.HeaderDescriptionTable.Count > 0);
     return info;
 }
        void CreateWorkflowManagementEndpoint(WorkflowServiceHost workflowServiceHost)
        {
            Binding controlEndpointBinding; 
            if (workflowServiceHost.InternalBaseAddresses.Contains(Uri.UriSchemeNetPipe))
            {
                controlEndpointBinding = NamedPipeControlEndpointBinding;
            }
            else if (workflowServiceHost.InternalBaseAddresses.Contains(Uri.UriSchemeHttp))
            {
                controlEndpointBinding = HttpControlEndpointBinding;
            }
            else
            {
                return;
            }

            Uri controlEndpointAddress = ServiceHost.GetVia(controlEndpointBinding.Scheme, new Uri(ControlEndpointAddress, UriKind.Relative), workflowServiceHost.InternalBaseAddresses);            
            XmlQualifiedName contractName = new XmlQualifiedName(XD2.WorkflowInstanceManagementService.ContractName, XD2.WorkflowServices.Namespace);
            //Create the Endpoint Dispatcher
            EndpointAddress address = new EndpointAddress(controlEndpointAddress.AbsoluteUri);
            EndpointDispatcher endpointDispatcher = new EndpointDispatcher(address,
                XD2.WorkflowInstanceManagementService.ContractName,
                XD2.WorkflowServices.Namespace, true)
            {
                ContractFilter = new ActionMessageFilter(
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.Abandon, null, false),
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.Cancel, null, false),
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.Run, null, false),
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.Suspend, null, false),
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.Terminate, null, false),
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.TransactedCancel, null, false),
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.TransactedRun, null, false),
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.TransactedSuspend, null, false),
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.TransactedTerminate, null, false),
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.TransactedUnsuspend, null, false),
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.TransactedUpdate, null, false),
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.Unsuspend, null, false),
                    NamingHelper.GetMessageAction(contractName, XD2.WorkflowInstanceManagementService.Update, null, false)),
            };

            //Create Listener
            ServiceEndpoint endpoint = new ServiceEndpoint(WorkflowControlEndpoint.WorkflowControlServiceContract, controlEndpointBinding, address);
            BindingParameterCollection parameters = workflowServiceHost.GetBindingParameters(endpoint);

            IChannelListener listener;
            if (controlEndpointBinding.CanBuildChannelListener<IDuplexSessionChannel>(controlEndpointAddress, parameters))
            {
                listener = controlEndpointBinding.BuildChannelListener<IDuplexSessionChannel>(controlEndpointAddress, parameters);
            }
            else if (controlEndpointBinding.CanBuildChannelListener<IReplySessionChannel>(controlEndpointAddress, parameters))
            {
                listener = controlEndpointBinding.BuildChannelListener<IReplySessionChannel>(controlEndpointAddress, parameters);
            }
            else
            {
                listener = controlEndpointBinding.BuildChannelListener<IReplyChannel>(controlEndpointAddress, parameters);
            }

            //Add the operations
            bool formatRequest;
            bool formatReply;
            foreach (OperationDescription operation in WorkflowControlEndpoint.WorkflowControlServiceContract.Operations)
            {
                DataContractSerializerOperationBehavior dataContractSerializerOperationBehavior = new DataContractSerializerOperationBehavior(operation);

                DispatchOperation operationDispatcher = new DispatchOperation(endpointDispatcher.DispatchRuntime, operation.Name,
                    NamingHelper.GetMessageAction(operation, false), NamingHelper.GetMessageAction(operation, true))
                {
                    Formatter = (IDispatchMessageFormatter)dataContractSerializerOperationBehavior.GetFormatter(operation, out formatRequest, out formatReply, false),
                    Invoker = new ControlOperationInvoker(
                        operation,
                        new WorkflowControlEndpoint(controlEndpointBinding, address),
                        null,
                        workflowServiceHost),
                };
                endpointDispatcher.DispatchRuntime.Operations.Add(operationDispatcher);

                OperationBehaviorAttribute operationAttribute = operation.Behaviors.Find<OperationBehaviorAttribute>();
                ((IOperationBehavior)operationAttribute).ApplyDispatchBehavior(operation, operationDispatcher);
            }

            DispatchRuntime dispatchRuntime = endpointDispatcher.DispatchRuntime;
            dispatchRuntime.ConcurrencyMode = ConcurrencyMode.Multiple;
            dispatchRuntime.InstanceContextProvider = new DurableInstanceContextProvider(workflowServiceHost);
            dispatchRuntime.InstanceProvider = new DurableInstanceProvider(workflowServiceHost);
            dispatchRuntime.ServiceAuthorizationManager = new WindowsAuthorizationManager(this.WindowsGroup);

            //Create the Channel Dispatcher
            ServiceDebugBehavior serviceDebugBehavior = workflowServiceHost.Description.Behaviors.Find<ServiceDebugBehavior>();
            ServiceBehaviorAttribute serviceBehaviorAttribute = workflowServiceHost.Description.Behaviors.Find<ServiceBehaviorAttribute>();

            bool includeDebugInfo = false;
            if (serviceDebugBehavior != null)
            {
                includeDebugInfo |= serviceDebugBehavior.IncludeExceptionDetailInFaults;
            }
            if (serviceBehaviorAttribute != null)
            {
                includeDebugInfo |= serviceBehaviorAttribute.IncludeExceptionDetailInFaults;
            }

            ChannelDispatcher channelDispatcher = new ChannelDispatcher(listener, controlEndpointBinding.Name, controlEndpointBinding)
            {
                MessageVersion = controlEndpointBinding.MessageVersion,
                Endpoints = { endpointDispatcher },
                ServiceThrottle = workflowServiceHost.ServiceThrottle
            };
            workflowServiceHost.ChannelDispatchers.Add(channelDispatcher);
        }
 public PartInfo(MessagePartDescription description, XmlDictionaryString dictionaryName, XmlDictionaryString dictionaryNamespace, IList<System.Type> knownTypes, DataContractSerializerOperationBehavior behavior)
 {
     this.dictionaryName = dictionaryName;
     this.dictionaryNamespace = dictionaryNamespace;
     this.description = description;
     this.knownTypes = knownTypes;
     this.serializerFactory = behavior;
 }
Exemplo n.º 37
0
        /// <summary>
        /// 创建和打开服务代理
        /// </summary>
        /// <returns></returns>
        public static TService CreateService()
        {
            Type    t          = typeof(TService);
            string  bindingKey = "binding:" + t.Name.ToLower();
            Binding binding    = GetBinding(bindingKey);
            string  urlKey     = "url:" + t.Name.ToLower();

            try
            {
                // new ContractDescriptionColletion

                if (!Configs.ContainsKey(urlKey))
                {
                    throw new KeyNotFoundException(string.Format("键URL:{0}未找到(键不区分大小写)。", t.Name));
                }
                if (!_factoryList.ContainsKey(urlKey))
                {
                    // ServiceEndpoint endPoint = new ServiceEndpoint(null, binding, GetEndpointAddress(urlKey));
                    // new ContractDescription{ Operations = new OperationDescriptionCollection()}

                    ChannelFactory <TService> factory = new ChannelFactory <TService>(binding, GetEndpointAddress(urlKey));
                    foreach (System.ServiceModel.Description.OperationDescription op in factory.Endpoint.Contract.Operations)
                    {
                        System.ServiceModel.Description.DataContractSerializerOperationBehavior dataContractBehavior =
                            op.Behaviors.Find <System.ServiceModel.Description.DataContractSerializerOperationBehavior>()
                            as System.ServiceModel.Description.DataContractSerializerOperationBehavior;
                        if (dataContractBehavior != null)
                        {
                            dataContractBehavior.MaxItemsInObjectGraph = int.MaxValue;
                        }
                    }
                    try
                    {
                        _factoryList.Add(urlKey, factory);
                    }
                    catch { }
                }
            }
            catch (Exception ex)
            {
                //LogHelper.LogWriter(ex);
            }
            return(_factoryList[urlKey].CreateChannel());
        }
 private PartInfo CreatePartInfo(MessagePartDescription part, OperationFormatStyle style, DataContractSerializerOperationBehavior serializerFactory)
 {
     this.ValidateDataContractType(part.Type);
     string s = ((style == OperationFormatStyle.Rpc) || (part.Namespace == null)) ? string.Empty : part.Namespace;
     return new PartInfo(part, base.AddToDictionary(part.Name), base.AddToDictionary(s), this.knownTypes, serializerFactory);
 }
Exemplo n.º 39
0
        void StartWCFService(Dictionary <Type, Type> serviceTypes, string servicePort)
        {
            servicePort = XML.Read(ConfigFile, "Service", "Port", servicePort);

            string endpointAddress = string.Empty;
            string tName           = string.Empty;

            foreach (var item in serviceTypes)
            {
                tName           = item.Key.Name.Substring(1);
                endpointAddress = string.Format("http://localhost:{0}/{1}", servicePort, tName);
                ServiceHost host = new ServiceHost(item.Value, new Uri(endpointAddress));

                WSHttpBinding wsHttpBinding = new WSHttpBinding();
                wsHttpBinding.MaxBufferPoolSize      = int.MaxValue;
                wsHttpBinding.MaxReceivedMessageSize = int.MaxValue;
                wsHttpBinding.ReceiveTimeout         = new TimeSpan(1, 0, 0);
                wsHttpBinding.Security      = new System.ServiceModel.WSHttpSecurity();
                wsHttpBinding.Security.Mode = SecurityMode.None;
                host.AddServiceEndpoint(item.Key, wsHttpBinding, string.Empty);

                ServiceMetadataBehavior behavior = host.Description.Behaviors.Find <ServiceMetadataBehavior>();
                {
                    if (behavior == null)
                    {
                        behavior = new ServiceMetadataBehavior();
                        behavior.HttpGetEnabled = true;
                        host.Description.Behaviors.Add(behavior);
                    }
                    else
                    {
                        behavior.HttpGetEnabled = true;
                    }
                }

                {
                    System.ServiceModel.Description.DataContractSerializerOperationBehavior dataContractBehavior =
                        host.Description.Behaviors.Find <System.ServiceModel.Description.DataContractSerializerOperationBehavior>()
                        as System.ServiceModel.Description.DataContractSerializerOperationBehavior;
                    if (dataContractBehavior != null)
                    {
                        dataContractBehavior.MaxItemsInObjectGraph = int.MaxValue;
                    }
                }

                host.Open();
                serviceHosts.Add(host);
            }
        }
Exemplo n.º 40
0
        static void StartWCFService(Dictionary <Type, Type> serviceTypes, string servicePort)
        {
            servicePort = XML.Read(ConfigFile, "Service", "Port", servicePort);

            string endpointAddress = string.Empty;
            string tName           = string.Empty;

            foreach (var item in serviceTypes)
            {
                tName           = item.Key.Name.Substring(1);
                endpointAddress = string.Format("http://localhost:{0}/{1}", servicePort, tName);
                ServiceHost host = new ServiceHost(item.Value, new Uri(endpointAddress));

                CustomBinding customBinding = new CustomBinding("GZipHttpBinding");
                customBinding.ReceiveTimeout = new TimeSpan(1, 0, 0);
                host.AddServiceEndpoint(item.Key, customBinding, string.Empty);

                ServiceMetadataBehavior behavior = host.Description.Behaviors.Find <ServiceMetadataBehavior>();
                {
                    if (behavior == null)
                    {
                        behavior = new ServiceMetadataBehavior();
                        behavior.HttpGetEnabled = true;
                        host.Description.Behaviors.Add(behavior);
                    }
                    else
                    {
                        behavior.HttpGetEnabled = true;
                    }
                }

                {
                    System.ServiceModel.Description.DataContractSerializerOperationBehavior dataContractBehavior =
                        host.Description.Behaviors.Find <System.ServiceModel.Description.DataContractSerializerOperationBehavior>()
                        as System.ServiceModel.Description.DataContractSerializerOperationBehavior;
                    if (dataContractBehavior != null)
                    {
                        dataContractBehavior.MaxItemsInObjectGraph = int.MaxValue;
                    }
                }

                host.Opened += delegate
                {
                    Console.WriteLine("{0}已经启动,按任意键终止服务!", tName);
                };

                host.Open();
                serviceHosts.Add(host);
            }

            Console.Read();
            if (serviceHosts != null)
            {
                foreach (ServiceHost t in serviceHosts)
                {
                    if (t != null)
                    {
                        t.Close();
                    }
                }
            }
        }