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 Property ParameterFormatter As Type

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
    Inherits System.Web.Services.Protocols.HttpGetClientProtocol

    Public Sub New()
        Me.Url = "http://www.contoso.com/username.asmx"
    End Sub 'NewNew

    <HttpMethodAttribute(GetType(XmlReturnReader), GetType(UrlParameterWriter))> _
    Public Function GetUserName() As UserName
        Return CType(Me.Invoke("GetUserName", Me.Url + "/GetUserName", New Object(0) {}), UserName)
    End Function 'GetUserName

    Public Function BeginGetUserName(callback As System.AsyncCallback, asyncState As Object) As System.IAsyncResult
        Return Me.BeginInvoke("GetUserName", Me.Url + "/GetUserName", New Object(0) {}, callback, asyncState)
    End Function 'BeginGetUserName

    Public Function EndGetUserName(asyncResult As System.IAsyncResult) As UserName
        Return CType(Me.EndInvoke(asyncResult), UserName)
    End Function 'EndGetUserName
End Class 'MyUser

<XmlRootAttribute(Namespace := "http://tempuri.org/", IsNullable := True)> _
Public Class UserName
    Public Name As String
    Public Domain As String

End Class 'UserName

.NET Framework
Available since 1.1
Return to top
Show: