Bagikan melalui


SoapServices.GetXmlNamespaceForMethodCall(MethodBase) Metode

Definisi

Mengambil namespace XML yang digunakan selama panggilan jarak jauh dari metode yang ditentukan dalam yang diberikan MethodBase.

public:
 static System::String ^ GetXmlNamespaceForMethodCall(System::Reflection::MethodBase ^ mb);
public static string GetXmlNamespaceForMethodCall (System.Reflection.MethodBase mb);
[System.Security.SecurityCritical]
public static string GetXmlNamespaceForMethodCall (System.Reflection.MethodBase mb);
static member GetXmlNamespaceForMethodCall : System.Reflection.MethodBase -> string
[<System.Security.SecurityCritical>]
static member GetXmlNamespaceForMethodCall : System.Reflection.MethodBase -> string
Public Shared Function GetXmlNamespaceForMethodCall (mb As MethodBase) As String

Parameter

mb
MethodBase

Metode MethodBase di mana namespace XML diminta.

Mengembalikan

Namespace XML yang digunakan selama panggilan jarak jauh dari metode yang ditentukan.

Atribut

Pengecualian

Pemanggil langsung tidak memiliki izin infrastruktur.

Contoh

Contoh kode berikut menunjukkan cara menggunakan metode ini. Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk SoapServices kelas .

// Print the XML namespace for a method invocation and its
// response.
System::Reflection::MethodBase^ getHelloMethod =
   ExampleNamespace::ExampleClass::typeid->GetMethod( L"GetHello" );
String^ methodCallXmlNamespace =
   SoapServices::GetXmlNamespaceForMethodCall( getHelloMethod );
String^ methodResponseXmlNamespace =
   SoapServices::GetXmlNamespaceForMethodResponse( getHelloMethod );
Console::WriteLine( L"The XML namespace for the invocation of the method "
L"GetHello in ExampleClass is {0}.", methodResponseXmlNamespace );
Console::WriteLine( L"The XML namespace for the response of the method "
L"GetHello in ExampleClass is {0}.", methodCallXmlNamespace );
// Print the XML namespace for a method invocation and its
// response.
System.Reflection.MethodBase getHelloMethod = 
    typeof(ExampleNamespace.ExampleClass).GetMethod("GetHello");
string methodCallXmlNamespace = 
    SoapServices.GetXmlNamespaceForMethodCall(getHelloMethod);
string methodResponseXmlNamespace =
    SoapServices.GetXmlNamespaceForMethodResponse(getHelloMethod);
Console.WriteLine(
    "The XML namespace for the invocation of the method " +
    "GetHello in ExampleClass is {0}.",
    methodResponseXmlNamespace);
Console.WriteLine(
    "The XML namespace for the response of the method " +
    "GetHello in ExampleClass is {0}.",
    methodCallXmlNamespace);

Berlaku untuk