Share via


SoapServices.GetXmlNamespaceForMethodResponse(MethodBase) Méthode

Définition

Récupère l'espace de noms XML utilisé durant la génération de réponses à l'appel distant à la méthode spécifiée dans le MethodBase donné.

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

Paramètres

mb
MethodBase

MethodBase de la méthode pour laquelle l'espace de noms XML a été demandé.

Retours

Espace de noms XML utilisé durant la génération de réponses à l'appel distant à une méthode.

Attributs

Exceptions

L'appelant immédiat n'a pas d'autorisation d'accès à l'infrastructure.

Exemples

L'exemple de code suivant montre comment utiliser cette méthode. Cet exemple de code fait partie d’un exemple plus grand fourni pour la SoapServices classe .

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

S’applique à