using System.Collections;
using System.Collections.Specialized;
using System.Configuration;
+using Microsoft.CSharp;
namespace System.Web.Services.Description {
public class ServiceDescriptionImporter {
#if NET_2_0
CodeGenerationOptions options;
- CodeDomProvider codeGenerator;
+ CodeDomProvider codeGenerator = new CSharpCodeProvider ();
ImportContext context;
#endif
if (appSettingUrlKey != null && appSettingUrlKey == string.Empty && style == ServiceDescriptionImportStyle.Server)
throw new InvalidOperationException ("Cannot set appSettingUrlKey if Style is Server");
- serviceDescriptions.Add (serviceDescription, appSettingUrlKey, appSettingBaseUrl);
+ OnServiceDescriptionAdded (serviceDescription, appSettingUrlKey, appSettingBaseUrl);
}
internal void OnServiceDescriptionAdded (ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl)
{
+ serviceDescriptions.Add (serviceDescription);
ImportInfo info = new ImportInfo (serviceDescription, appSettingUrlKey, appSettingBaseUrl);
importInfo.Add (info);
{
ProtocolImporter importer = GetImporter ();
- if (!importer.Import (this, codeNamespace, codeCompileUnit, importInfo))
+ if (!importer.Import (this, codeNamespace, importInfo))
throw new Exception ("None of the supported bindings was found");
return importer.Warnings;
foreach (WebReference reference in webReferences)
{
ServiceDescriptionImporter importer = new ServiceDescriptionImporter ();
- importer.CodeGenerator = codeGenerator;
+ if (codeGenerator != null)
+ importer.CodeGenerator = codeGenerator;
importer.CodeGenerationOptions = options.CodeGenerationOptions;
importer.Context = context;
importer.Style = options.Style;