Exemplo n.º 1
0
        public MetadataGenerationResult EmitSmdJson(XmlDocSource xmlDocSource, bool includeDemoValue, JObject schema)
        {
            var result = new MetadataGenerationResult();
            JObject smd = new JObject
                              {
                                  {"SMDVersion","2.6"},
                                  {"version",xmlDocSource.RouteAssembly.Version},
                                  {"description","CIAPI SMD"},
                                  {"services", new JObject()}
                              };

            var rpc = new JObject();
            smd["services"]["rpc"] = rpc;
            rpc["target"] = "";
            JObject rpcServices = new JObject();
            rpc["services"] = rpcServices;

            var seenTypes = new List<Type>(); // just to keep track of types so we don't map twice

            foreach (RouteElement route in xmlDocSource.Routes)
            {
                var serviceResult = BuildServiceMapping(xmlDocSource, route, seenTypes, rpcServices, includeDemoValue, schema);
                result.AddValidationResults(serviceResult);
            }

            result.SMD = smd;
            return result;
        }
Exemplo n.º 2
0
        public MetadataGenerationResult EmitSmdJson(XmlDocSource xmlDocSource, bool includeDemoValue, JObject schema)
        {
            var     result = new MetadataGenerationResult();
            JObject smd    = new JObject
            {
                { "SMDVersion", "2.6" },
                { "version", xmlDocSource.RouteAssembly.Version },
                { "description", "CIAPI SMD" },
                { "services", new JObject() }
            };

            var rpc = new JObject();

            smd["services"]["rpc"] = rpc;
            rpc["target"]          = "";
            JObject rpcServices = new JObject();

            rpc["services"] = rpcServices;

            var seenTypes = new List <Type>(); // just to keep track of types so we don't map twice

            foreach (RouteElement route in xmlDocSource.Routes)
            {
                var serviceResult = BuildServiceMapping(xmlDocSource, route, seenTypes, rpcServices, includeDemoValue, schema);
                result.AddValidationResults(serviceResult);
            }

            result.SMD = smd;
            return(result);
        }
        public void Context()
        {
            _xmlDocSource = CreateXmlDocSourceForTestAssembly(
               new List<RouteElement>{
                  new RouteElement {
                                    Endpoint = ENDPOINT1,
                                    Name = "GetDetail",
                                    Type = "TestAssembly.Service.ISimpleService, TestAssembly.Service, Version=1.0.0.0"}
                  ,
            });

            _jsonSchema = new JsonSchemaDtoEmitter().EmitDtoJson(_xmlDocSource);
            _smdSchema = new WcfSMD.Emitter().EmitSmdJson(_xmlDocSource, true, _jsonSchema);
        }
Exemplo n.º 4
0
        public void Context()
        {
            _xmlDocSource = CreateXmlDocSourceForTestAssembly(
                new List <RouteElement> {
                new RouteElement {
                    Endpoint = ENDPOINT1,
                    Name     = "GetDetail",
                    Type     = "TestAssembly.Service.ISimpleService, TestAssembly.Service, Version=1.0.0.0"
                }
                ,
            });

            _jsonSchema = new JsonSchemaDtoEmitter().EmitDtoJson(_xmlDocSource);
            _smdSchema  = new WcfSMD.Emitter().EmitSmdJson(_xmlDocSource, true, _jsonSchema);
        }