SoapServices.GetXmlNamespaceForMethodResponse(MethodBase) Method

Definition

Retrieves the XML namespace used during the generation of responses to the remote call to the method specified in the given MethodBase.

C#
public static string GetXmlNamespaceForMethodResponse(System.Reflection.MethodBase mb);
C#
[System.Security.SecurityCritical]
public static string GetXmlNamespaceForMethodResponse(System.Reflection.MethodBase mb);

Parameters

mb
MethodBase

The MethodBase of the method for which the XML namespace was requested.

Returns

The XML namespace used during the generation of responses to a remote method call.

Attributes

Exceptions

The immediate caller does not have infrastructure permission.

Examples

The following code example shows how to use this method. This code example is part of a larger example provided for the SoapServices class.

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

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1