DiscoveryReference GenerateWebReferences(WebReference reference, CodeCompileUnit compileUnit)
        {
            var result = new DiscoveryReference();

            CheckInteroperabilityConformance(reference, result);

            var webReferences = new WebReferenceCollection {
                reference
            };
            var options = new WebReferenceOptions {
                CodeGenerationOptions = CodeGenerationOptions.GenerateProperties
            };

            ServiceDescriptionImporter.GenerateWebReferences(
                webReferences, codeProvider, compileUnit, options);
            CheckDescriptionImportValidations(reference, result);

            if (!result.HasErrors)
            {
                result.CodeDom      = compileUnit;
                result.CodeProvider = codeProvider;
                result.Bindings.AddRange(
                    GetSoapBindings(discovery.GetServices()));
            }

            return(result);
        }
        public Proxy Build(AssemblyName assemblyName, string nameSpace)
        {
            var description = discovery.GetServices().First();
            var assembly    = BuildAssembly(assemblyName, nameSpace);

            return(new Proxy {
                Namespace = nameSpace,
                Description = description,
                Assembly = assembly
            });
        }