{"id":28195354,"url":"https://github.com/artema/dotamf","last_synced_at":"2025-05-16T14:13:10.317Z","repository":{"id":2696791,"uuid":"3690144","full_name":"artema/DotAmf","owner":"artema","description":".NET serializer and WCF bindings for AMF with full Flex compatibility. Just add AMF endpoints to your existing WCF services and you are ready to go.","archived":false,"fork":false,"pushed_at":"2015-11-29T14:34:34.000Z","size":2712,"stargazers_count":16,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-21T11:07:50.657Z","etag":null,"topics":["amf","amf3","csharp","dotnet","flash","flex","wcf","wcf-bindings","wcf-service"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"ms-pl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artema.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-11T22:18:38.000Z","updated_at":"2024-05-07T13:54:19.000Z","dependencies_parsed_at":"2022-08-28T12:22:27.787Z","dependency_job_id":null,"html_url":"https://github.com/artema/DotAmf","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artema%2FDotAmf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artema%2FDotAmf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artema%2FDotAmf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artema%2FDotAmf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artema","download_url":"https://codeload.github.com/artema/DotAmf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544154,"owners_count":22088808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amf","amf3","csharp","dotnet","flash","flex","wcf","wcf-bindings","wcf-service"],"created_at":"2025-05-16T14:13:07.671Z","updated_at":"2025-05-16T14:13:10.294Z","avatar_url":"https://github.com/artema.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"NuGet packages: [DotAmf](https://www.nuget.org/packages/DotAmf/) (serializer) and [DotAmf.Wcf](https://www.nuget.org/packages/DotAmf.Wcf/) (service layer).\r\n\r\n# About #\r\n\r\n.NET serializer and WCF bindings for AMF with full Flex remoting support.\r\n\r\n\u003e Action Message Format (AMF) is a binary format used to serialize object graphs such as ActionScript objects and XML, or send messages between an Adobe Flash client and a remote service, usually a Flash Media Server or third party alternatives. The Actionscript 3 language provides classes for encoding and decoding from the AMF format.\r\n\u003e\r\n\u003e [http://en.wikipedia.org/wiki/Action\\_Message\\_Format](http://en.wikipedia.org/wiki/Action_Message_Format)\r\n\r\nAMF has several advantages over existing serialization formats, including the ability to maintain objects graph, a small footprint when storing a set of identical objects (including strings) or references to the same object, and a wide range of natively supported types (such as `XmlDocument`, `DateTime` and `Dictionary`).\r\n\r\n# WCF Configuration #\r\n\r\nConsider the following service contracts:\r\n\r\n        using System;\r\n        using System.Runtime.Serialization;\r\n        using System.ServiceModel;\r\n        using System.Xml;\r\n\r\n        namespace ExampleService\r\n        {\r\n            [ServiceContract]\r\n            public interface IMyService\r\n            {\r\n                [OperationContract]\r\n                ProductVo[] GetAllProducts();\r\n\r\n                [OperationContract(Name = \"GetUser\")] //Custom procedure name\r\n                User GetUserDataContract(int id);\r\n\r\n                [OperationContract]\r\n                int AddUser(User user);\r\n\r\n                [OperationContract]\r\n                Content SendContent(Content content);\r\n\r\n                [OperationContract]\r\n                User[] SendGraph(User[] users);\r\n\r\n                [OperationContract]\r\n                void DoStuff();\r\n\r\n                [OperationContract]\r\n                [FaultContract(typeof(CustomFault))]\r\n                void DoFault();\r\n            }\r\n\r\n            [DataContract] //Will have the \"ExampleService.User\" alias\r\n            public class User\r\n            {\r\n                [DataMember(Name = \"id\")] //Custom field name\r\n                public int Id { get; set; }\r\n\r\n                [DataMember(Name = \"is_active\")]\r\n                public bool IsActive { get; set; }\r\n\r\n                [DataMember] //Use explicit name\r\n                public string name { get; set; }\r\n\r\n                [DataMember(Name = \"products\")]\r\n                public ProductVo[] Products { get; set; }\r\n            }\r\n\r\n            [DataContract(Name = \"Product\")] //Custom alias\r\n            public class ProductVo\r\n            {\r\n                [DataMember(Name = \"id\")]\r\n                public int Id { get; set; }\r\n            }\r\n\r\n            [DataContract]\r\n            public class CustomFault\r\n            {\r\n                [DataMember(Name = \"date\")]\r\n                public DateTime Date { get; set; }\r\n\r\n                [DataMember(Name = \"message\")]\r\n                public string Message { get; set; }\r\n            }\r\n\r\n            [DataContract]\r\n            public class Content\r\n            {\r\n                [DataMember(Name = \"data\")]\r\n                public byte[] Data { get; set; }\r\n\r\n                [DataMember(Name = \"xml\")]\r\n                public XmlDocument Xml { get; set; }\r\n            }\r\n        }\r\n\r\nTo add an AMF support to a service, you only need to update your configuration:\r\n\r\n    \u003c?xml version=\"1.0\"?\u003e\r\n    \u003cconfiguration\u003e\r\n      \u003csystem.web\u003e\r\n        \u003ccompilation debug=\"true\" targetFramework=\"4.0\" /\u003e\r\n      \u003c/system.web\u003e\r\n      \u003csystem.serviceModel\u003e\r\n        \u003cextensions\u003e\r\n          \u003cbehaviorExtensions\u003e\r\n            \u003cadd name=\"amfBehaviorExtension\" type=\"DotAmf.ServiceModel.Configuration.AmfBehaviorExtensionElement, DotAmf.Wcf\"/\u003e\r\n          \u003c/behaviorExtensions\u003e\r\n          \u003cbindingElementExtensions\u003e\r\n            \u003cadd name=\"amfBindingExtension\" type=\"DotAmf.ServiceModel.Configuration.AmfBindingExtensionElement, DotAmf.Wcf\"/\u003e\r\n          \u003c/bindingElementExtensions\u003e\r\n        \u003c/extensions\u003e\r\n        \u003cbehaviors\u003e\r\n          \u003cendpointBehaviors\u003e\r\n            \u003cbehavior name=\"amfEndpoint\"\u003e\r\n              \u003camfBehaviorExtension/\u003e\r\n            \u003c/behavior\u003e\r\n          \u003c/endpointBehaviors\u003e\r\n          \u003cserviceBehaviors\u003e\r\n            \u003cbehavior name=\"amfServiceBehavior\"\u003e\r\n              \u003cserviceMetadata httpGetEnabled=\"false\"/\u003e\r\n              \u003cserviceDebug includeExceptionDetailInFaults=\"true\" httpHelpPageEnabled=\"false\"/\u003e\r\n            \u003c/behavior\u003e\r\n          \u003c/serviceBehaviors\u003e\r\n        \u003c/behaviors\u003e\r\n        \u003cbindings\u003e\r\n          \u003ccustomBinding\u003e\r\n            \u003cbinding name=\"amfBinding\"\u003e\r\n              \u003camfBindingExtension/\u003e\r\n              \u003chttpTransport/\u003e\r\n            \u003c/binding\u003e\r\n          \u003c/customBinding\u003e\r\n        \u003c/bindings\u003e\r\n        \u003cservices\u003e\r\n          \u003cservice name=\"ExampleService.MyService\" behaviorConfiguration=\"amfServiceBehavior\"\u003e\r\n            \u003cendpoint address=\"\" contract=\"ExampleService.IMyService\" binding=\"customBinding\" bindingConfiguration=\"amfBinding\" behaviorConfiguration=\"amfEndpoint\"/\u003e\r\n          \u003c/service\u003e\r\n        \u003c/services\u003e\r\n        \u003cserviceHostingEnvironment multipleSiteBindingsEnabled=\"true\"/\u003e\r\n      \u003c/system.serviceModel\u003e\r\n     \u003csystem.webServer\u003e\r\n        \u003cmodules runAllManagedModulesForAllRequests=\"true\"/\u003e\r\n        \u003cdirectoryBrowse enabled=\"false\"/\u003e\r\n      \u003c/system.webServer\u003e\r\n    \u003c/configuration\u003e\r\n\r\nSee the `Examples` folder for a complete service and client implementations.\r\n\r\n# Serialization #\r\n\r\nYou can use `DataContractAmfSerializer` to serialize and deserialize from binary AMF data outside of the WCF.\r\n\r\n    CustomType objectToWrite;\r\n\r\n    var knownTypes = new[] {\r\n        typeof(KnownType1),\r\n        typeof(KnownType2)\r\n    };\r\n    var serializer = new DataContractAmfSerializer(typeof(CustomType), knownTypes);\r\n\r\n    using (var stream = new MemoryStream())\r\n        serializer.WriteObject(stream, objectToWrite);","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartema%2Fdotamf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartema%2Fdotamf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartema%2Fdotamf/lists"}