Exemple #1
0
        private void ReflectInternal(ProtocolReflector[] reflectors)
        {
            this.description = new System.Web.Services.Description.ServiceDescription();
            this.description.TargetNamespace = this.serviceAttr.Namespace;
            this.ServiceDescriptions.Add(this.description);
            this.service = new System.Web.Services.Description.Service();
            string name = this.serviceAttr.Name;

            if ((name == null) || (name.Length == 0))
            {
                name = this.serviceType.Name;
            }
            this.service.Name = XmlConvert.EncodeLocalName(name);
            if ((this.serviceAttr.Description != null) && (this.serviceAttr.Description.Length > 0))
            {
                this.service.Documentation = this.serviceAttr.Description;
            }
            this.description.Services.Add(this.service);
            this.reflectionContext = new Hashtable();
            this.exporter          = new XmlSchemaExporter(this.description.Types.Schemas);
            this.importer          = SoapReflector.CreateXmlImporter(this.serviceAttr.Namespace, SoapReflector.ServiceDefaultIsEncoded(this.serviceType));
            WebMethodReflector.IncludeTypes(this.methods, this.importer);
            for (int i = 0; i < reflectors.Length; i++)
            {
                reflectors[i].Reflect();
            }
        }
Exemple #2
0
        private void ReflectInternal(ProtocolReflector[] reflectors)
        {
            description = new ServiceDescription();
            description.TargetNamespace = serviceAttr.Namespace;
            ServiceDescriptions.Add(description);

            service = new Service();
            string name = serviceAttr.Name;

            if (name == null || name.Length == 0)
            {
                name = serviceType.Name;
            }
            service.Name = XmlConvert.EncodeLocalName(name);

            if (serviceAttr.Description != null && serviceAttr.Description.Length > 0)
            {
                service.Documentation = serviceAttr.Description;
            }
            description.Services.Add(service);

            reflectionContext = new Hashtable();
            exporter          = new XmlSchemaExporter(description.Types.Schemas);
            importer          = SoapReflector.CreateXmlImporter(serviceAttr.Namespace, SoapReflector.ServiceDefaultIsEncoded(serviceType));
            WebMethodReflector.IncludeTypes(methods, importer);

            for (int i = 0; i < reflectors.Length; i++)
            {
                reflectors[i].Reflect();
            }
        }