SoapServices.GetXmlNamespaceForMethodCall(MethodBase) Метод

Определение

Извлекает пространство имен XML, используемое во время удаленных вызовов метода, указанного в заданном.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

Параметры

mb
MethodBase

Метод MethodBase , для которого запрашивается пространство имен XML.

Возвращаемое значение

Пространство имен XML, используемое во время удаленных вызовов указанного метода.

Атрибуты

Исключения

Непосредственный вызывающий объект не имеет разрешения на инфраструктуру.

Примеры

В следующем примере кода показано, как использовать этот метод. Этот пример кода является частью более крупного примера, предоставленного для SoapServices класса.

// 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);

Применяется к