Export (0) Print
Expand All

SoapDocumentMethodAttribute.ResponseNamespace Property

Gets or sets the XML namespace associated with the SOAP response for an XML Web service method.

Namespace:  System.Web.Services.Protocols
Assembly:  System.Web.Services (in System.Web.Services.dll)

public string ResponseNamespace { get; set; }

Property Value

Type: System.String
The XML namespace associated with the SOAP response for an XML Web service method. The default is http://tempuri.org/.

The ResponseNamespace property is used in the XSD schema for the XML Web service method in its service description.

The following code example sets the ResponseNamespace property to http://www.contoso.com.

<%@ WebService Language="C#" Class="SoapDocumentMethodSample" %>
	
using System.Web.Services;
using System.Web.Services.Protocols;

public class SoapDocumentMethodSample
{
   [WebMethod]
   [SoapDocumentMethod(ResponseNamespace="http://www.contoso.com",ResponseElementName="MyCustomResponseElement")]
   public int[] ResponseDocument(int numentries)
   {
	int[] intarray = new int[numentries];
        for (int i=0;i<numentries;i++)
        {
	   intarray[i] = i;
        }
        return intarray;
   }
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft