ServiceDescriptionImportStyle 枚举
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指定是对服务器还是对客户端计算机进行导入。
public enum class ServiceDescriptionImportStyle
public enum ServiceDescriptionImportStyle
type ServiceDescriptionImportStyle =
Public Enum 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
注解
对客户端计算机进行的导入会生成具有同步和异步方法的代理类,以在 XML Web 服务中调用每个方法。 另一方面,服务器导入会生成包含抽象成员的抽象类,必须重写该类以提供所需的实现。