共用方式為


ServiceDescriptionImportStyle 列舉

定義

指定是要匯入至伺服器,還是用戶端電腦。

public enum class ServiceDescriptionImportStyle
public enum ServiceDescriptionImportStyle
type ServiceDescriptionImportStyle = 
Public Enum ServiceDescriptionImportStyle
繼承
ServiceDescriptionImportStyle

欄位

Client 0

指定應該向用戶端電腦進行匯入。

Server 1

指定應該向伺服器進行匯入。

ServerInterface 2

指定應該向伺服器介面進行匯入。

範例

#using <System.Web.Services.dll>
#using <System.dll>
#using <System.Xml.dll>

using namespace System;
using namespace System::Web::Services::Description;
int main()
{
   try
   {
      ServiceDescription^ myServiceDescription = ServiceDescription::Read( "Sample_cpp.wsdl" );
      ServiceDescriptionImporter^ myImporter = gcnew ServiceDescriptionImporter;
      myImporter->ProtocolName = "Soap";
      myImporter->AddServiceDescription( myServiceDescription, "", "" );
      
      ServiceDescriptionImportStyle myStyle = myImporter->Style;
      Console::WriteLine( "Import style: {0}", myStyle );
      
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Following exception was thrown: {0}", e );
   }

}
using System;
using System.Web.Services.Description;

namespace MyServiceDescription
{
   class MyImporter
   {
      public static void Main()
      {
         try
         {
            ServiceDescription myServiceDescription =
               ServiceDescription.Read("Sample_CS.wsdl");

            ServiceDescriptionImporter myImporter =
               new ServiceDescriptionImporter();

            myImporter.ProtocolName = "Soap";
            myImporter.AddServiceDescription(myServiceDescription, "", "");
            ServiceDescriptionImportStyle myStyle = myImporter.Style;
            Console.WriteLine("Import style: " + myStyle.ToString());
         }
         catch (Exception e)
         {
            Console.WriteLine("Following exception was thrown: "
               + e.ToString());
         }
      }
   }
}
Imports System.Web.Services.Description

Namespace MyServiceDescription
   Class MyImporter
      Public Shared Sub Main()
         Try
            Dim myServiceDescription As ServiceDescription = _
                                       ServiceDescription.Read("Sample_vb.wsdl")
            Dim myImporter As New ServiceDescriptionImporter()
            myImporter.ProtocolName = "Soap"
            myImporter.AddServiceDescription(myServiceDescription, "", "")
            Dim myStyle As ServiceDescriptionImportstyle = myImporter.Style
            Console.WriteLine("Import style: " + myStyle.ToString())
         Catch e As Exception
            Console.WriteLine("Following exception was thrown: " + e.ToString())
         End Try
      End Sub
   End Class
End Namespace 'MyServiceDescription

備註

對用戶端電腦進行的匯入會產生具有同步和非同步方法的 Proxy 類別,以叫用 XML Web 服務內的每個方法。 另一方面,伺服器匯入會產生抽象成員的抽象類別,您必須覆寫此類別以提供您需要的實作。

適用於