SudsWriter.cs

  1. // ==++==
  2. // 
  3. //   
  4. //    Copyright (c) 2002 Microsoft Corporation.  All rights reserved.
  5. //   
  6. //    The use and distribution terms for this software are contained in the file
  7. //    named license.txt, which can be found in the root of this distribution.
  8. //    By using this software in any fashion, you are agreeing to be bound by the
  9. //    terms of this license.
  10. //   
  11. //    You must not remove this notice, or any other, from this software.
  12. //   
  13. // 
  14. // ==--==
  15. //============================================================
  16. //
  17. // File:    SudsWriter.cs
  18. // Purpose: Defines SUDSParser that parses a given SUDS document
  19. //          and generates types defined in it.
  20. //
  21. // Date:    April 01, 2000
  22. // Revised: November 15, 2000 (Wsdl)                       
  23. //
  24. //============================================================
  25. namespace System.Runtime.Remoting.MetadataServices
  26. {
  27.     using System;
  28.     using System.IO;
  29.     using System.Reflection;
  30.     // Represents exceptions thrown by the SUDSGenerator
  31.     /// <include file='doc/SudsWriter.uex' path='docs/doc[@for="SUDSGeneratorException"]/*' />
  32.     public class SUDSGeneratorException : Exception
  33.     {
  34.         internal SUDSGeneratorException(String msg)
  35.                 : base(msg)
  36.         {
  37.         }
  38.     }
  39.     // This class generates SUDS documents
  40.     internal class SUDSGenerator
  41.     {
  42.         WsdlGenerator wsdlGenerator = null;
  43.         SdlGenerator sdlGenerator = null;
  44.         SdlType sdlType;
  45.         // Constructor
  46.         internal SUDSGenerator(Type[] types, TextWriter output)
  47.         {
  48.             Util.Log("SUDSGenerator.SUDSGenerator 1");
  49.             wsdlGenerator = new WsdlGenerator(types, output);
  50.             sdlType = SdlType.Wsdl;
  51.         }
  52.         // Constructor
  53.         internal SUDSGenerator(Type[] types, SdlType sdlType, TextWriter output)
  54.         {
  55.             Util.Log("SUDSGenerator.SUDSGenerator 2");
  56.             if (sdlType == SdlType.Sdl)
  57.                 sdlGenerator = new SdlGenerator(types, sdlType, output);
  58.             else
  59.                 wsdlGenerator = new WsdlGenerator(types, sdlType, output);
  60.             this.sdlType = sdlType;
  61.         }
  62.         // Constructor
  63.         internal SUDSGenerator(Type[] types, TextWriter output, Assembly assembly, String url)
  64.         {
  65.             Util.Log("SUDSGenerator.SUDSGenerator 3 "+url);
  66.             wsdlGenerator = new WsdlGenerator(types, output, assembly, url);
  67.             sdlType = SdlType.Wsdl;
  68.         }
  69.         // Constructor
  70.         internal SUDSGenerator(Type[] types, SdlType sdlType, TextWriter output, Assembly assembly, String url)
  71.         {
  72.             Util.Log("SUDSGenerator.SUDSGenerator 4 "+url);            
  73.             if (sdlType == SdlType.Sdl)
  74.                 sdlGenerator = new SdlGenerator(types, sdlType, output, assembly, url);
  75.             else
  76.                 wsdlGenerator = new WsdlGenerator(types, sdlType, output, assembly, url);
  77.             this.sdlType =sdlType;
  78.         }
  79.         internal SUDSGenerator(ServiceType[] serviceTypes, SdlType sdlType, TextWriter output)
  80.         {
  81.             Util.Log("SUDSGenerator.SUDSGenerator 5 ");
  82.             if (sdlType == SdlType.Sdl)
  83.                 sdlGenerator = new SdlGenerator(serviceTypes, sdlType, output);
  84.             else
  85.                 wsdlGenerator = new WsdlGenerator(serviceTypes, sdlType, output);
  86.             this.sdlType = sdlType;
  87.         }
  88.         // Generates SUDS
  89.         internal void Generate()
  90.         {
  91.             Util.Log("SUDSGenerator.Generate");            
  92.             if (sdlType == SdlType.Sdl)
  93.                 sdlGenerator.Generate();
  94.             else
  95.                 wsdlGenerator.Generate();
  96.         }
  97.     }
  98. }
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值