Export (0) Print
Expand All

HttpMethodAttribute.ParameterFormatter Property

Gets or sets a Type that serializes parameters sent from an XML Web service client to the XML Web service method.

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

public Type ParameterFormatter { get; set; }

Property Value

Type: System.Type
A Type that serializes parameters sent from an XML Web service client to an XML Web service method. There is no default.

If the XML Web service client is invoking an XML Web service method using HTTP-GET or HTTP-POST, ParameterFormatter must be XMLReturnReader.

The example is a proxy class generated by the Wsdl.exe utility for an XML Web service client using HTTP-GET, setting ParameterFormatter to the required value of XMLReturnReader.


public class MyUser : System.Web.Services.Protocols.HttpGetClientProtocol {

    public MyUser() {
        this.Url = "http://www.contoso.com/username.asmx";
    }

    [System.Web.Services.Protocols.HttpMethodAttribute(typeof(System.Web.Services.Protocols.XmlReturnReader), typeof(System.Web.Services.Protocols.UrlParameterWriter))]
    public UserName GetUserName() {
        return ((UserName)(this.Invoke("GetUserName", (this.Url + "/GetUserName"), new object[0])));
    }

    public System.IAsyncResult BeginGetUserName(System.AsyncCallback callback, object asyncState) {
        return this.BeginInvoke("GetUserName", (this.Url + "/GetUserName"), new object[0], callback, asyncState);
    }

    public UserName EndGetUserName(System.IAsyncResult asyncResult) {
        return ((UserName)(this.EndInvoke(asyncResult)));
    }
}

[System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.org/", IsNullable=true)]
public class UserName {

    public string Name;

    public string Domain;
}



.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft